diff --git a/Makefile b/Makefile index cff224b7..28b6d8b2 100644 --- a/Makefile +++ b/Makefile @@ -458,6 +458,7 @@ PACKAGE_DIRS := \ apps/ \ core/ \ deps/codemirror/ \ + deps/lit/ \ deps/split/ \ deps/smoothie/ diff --git a/src/socket.js.c b/src/socket.js.c index b4c9557b..afbeedc5 100644 --- a/src/socket.js.c +++ b/src/socket.js.c @@ -1113,7 +1113,7 @@ JSValue _sockets_get(JSContext* context, JSValueConst this_val, int argc, JSValu JS_SetPropertyStr(context, entry, "listening", JS_NewBool(context, s->_listening)); JS_SetPropertyStr(context, entry, "connected", JS_NewBool(context, s->_connected)); JS_SetPropertyStr(context, entry, "tls", JS_NewBool(context, s->_tls != NULL)); - JS_SetPropertyStr(context, entry, "age_seconds", JS_NewFloat64(context, (uv_now(tf_task_get_loop(s->_task)) - s->created_ms) / 1000.f)); + JS_SetPropertyStr(context, entry, "age_seconds", JS_NewFloat64(context, (uv_now(tf_task_get_loop(s->_task)) - s->created_ms) / 1000.0)); JS_SetPropertyStr(context, entry, "info", JS_DupValue(context, s->_info)); JS_SetPropertyUint32(context, array, i, entry); } diff --git a/src/task.c b/src/task.c index 5f983f00..4398c294 100644 --- a/src/task.c +++ b/src/task.c @@ -767,21 +767,21 @@ static JSValue _tf_task_getStats(JSContext* context, JSValueConst this_val, int JS_SetPropertyStr(context, result, "export_count", JS_NewInt32(context, task->_export_count)); JS_SetPropertyStr(context, result, "promise_count", JS_NewInt32(context, task->_promise_count)); - JS_SetPropertyStr(context, result, "cpu_percent", JS_NewFloat64(context, 100.0f - task->idle_percent)); - JS_SetPropertyStr(context, result, "thread_percent", JS_NewFloat64(context, task->thread_percent)); + JS_SetPropertyStr(context, result, "cpu_percent", JS_NewFloat64(context, 100.0 - (double)task->idle_percent)); + JS_SetPropertyStr(context, result, "thread_percent", JS_NewFloat64(context, (double)task->thread_percent)); uint64_t total_memory = uv_get_total_memory(); size_t rss; if (uv_resident_set_memory(&rss) == 0) { - JS_SetPropertyStr(context, result, "memory_percent", JS_NewFloat64(context, 100.0f * rss / total_memory)); + JS_SetPropertyStr(context, result, "memory_percent", JS_NewFloat64(context, 100.0 * rss / total_memory)); } - JS_SetPropertyStr(context, result, "sqlite3_memory_percent", JS_NewFloat64(context, 100.0f * tf_mem_get_sqlite_malloc_size() / total_memory)); - JS_SetPropertyStr(context, result, "js_malloc_percent", JS_NewFloat64(context, 100.0f * tf_mem_get_js_malloc_size() / total_memory)); - JS_SetPropertyStr(context, result, "uv_malloc_percent", JS_NewFloat64(context, 100.0f * tf_mem_get_uv_malloc_size() / total_memory)); - JS_SetPropertyStr(context, result, "tls_malloc_percent", JS_NewFloat64(context, 100.0f * tf_mem_get_tls_malloc_size() / total_memory)); - JS_SetPropertyStr(context, result, "tf_malloc_percent", JS_NewFloat64(context, 100.0f * tf_mem_get_tf_malloc_size() / total_memory)); + JS_SetPropertyStr(context, result, "sqlite3_memory_percent", JS_NewFloat64(context, 100.0 * tf_mem_get_sqlite_malloc_size() / total_memory)); + JS_SetPropertyStr(context, result, "js_malloc_percent", JS_NewFloat64(context, 100.0 * tf_mem_get_js_malloc_size() / total_memory)); + JS_SetPropertyStr(context, result, "uv_malloc_percent", JS_NewFloat64(context, 100.0 * tf_mem_get_uv_malloc_size() / total_memory)); + JS_SetPropertyStr(context, result, "tls_malloc_percent", JS_NewFloat64(context, 100.0 * tf_mem_get_tls_malloc_size() / total_memory)); + JS_SetPropertyStr(context, result, "tf_malloc_percent", JS_NewFloat64(context, 100.0 * tf_mem_get_tf_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())); @@ -891,7 +891,7 @@ static JSValue _tf_task_getHitches(JSContext* context, JSValueConst this_val, in { if (*task->hitches[i].name) { - JS_SetPropertyStr(context, result, task->hitches[i].name, JS_NewFloat64(context, task->hitches[i].duration_ns / 1e9f)); + JS_SetPropertyStr(context, result, task->hitches[i].name, JS_NewFloat64(context, task->hitches[i].duration_ns / 1e9)); } } tf_trace_end(task->_trace);