Hook up some stats from the SSB side.

git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3822 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
2022-02-05 20:18:58 +00:00
parent ef9e42e030
commit 1aa4b0e590
3 changed files with 69 additions and 5 deletions

View File

@ -730,6 +730,17 @@ static JSValue _tf_task_getStats(JSContext* context, JSValueConst this_val, int
{
JS_SetPropertyStr(context, result, "rss", JS_NewInt64(context, rss));
}
if (task->_ssb)
{
tf_ssb_stats_t ssb_stats = { 0 };
tf_ssb_get_stats(task->_ssb, &ssb_stats);
JS_SetPropertyStr(context, result, "messages_stored", JS_NewInt32(context, ssb_stats.messages_stored));
JS_SetPropertyStr(context, result, "rpc_in", JS_NewInt32(context, ssb_stats.rpc_in));
JS_SetPropertyStr(context, result, "rpc_out", JS_NewInt32(context, ssb_stats.rpc_out));
}
return result;
}