Track OpenSSL memory usage.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3890 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-06-04 15:59:58 +00:00
parent c8e09d8637
commit 7b53c95832
4 changed files with 64 additions and 16 deletions

View File

@ -739,7 +739,8 @@ static JSValue _tf_task_getStats(JSContext* context, JSValueConst this_val, int
JS_ComputeMemoryUsage(runtime, &js);
JS_SetPropertyStr(context, result, "js_malloc_percent", JS_NewFloat64(context, 100.0f * js.malloc_size / total_memory));
JS_SetPropertyStr(context, result, "uv_malloc_percent", JS_NewFloat64(context, 100.0f * tf_util_uv_get_malloc_size() / total_memory));
JS_SetPropertyStr(context, result, "uv_malloc_percent", JS_NewFloat64(context, 100.0f * tf_util_get_uv_malloc_size() / total_memory));
JS_SetPropertyStr(context, result, "tls_malloc_percent", JS_NewFloat64(context, 100.0f * tf_util_get_tls_malloc_size() / total_memory));
JS_SetPropertyStr(context, result, "socket_count", JS_NewInt32(context, tf_socket_get_count()));
JS_SetPropertyStr(context, result, "socket_open_count", JS_NewInt32(context, tf_socket_get_open_count()));