diff --git a/awareness.el b/awareness.el index cebebf2..f48cfa7 100644 --- a/awareness.el +++ b/awareness.el @@ -43,7 +43,8 @@ fn emit_heartbeat() -> Void { let ts: Int = time_now() let nc: Int = engram_node_count() let ec: Int = engram_edge_count() - let payload: String = "{\"event\":\"heartbeat\",\"pulse\":" + pulse + ",\"boot\":" + boot + ",\"idle\":" + idle + ",\"node_count\":" + int_to_str(nc) + ",\"edge_count\":" + int_to_str(ec) + ",\"ts\":" + int_to_str(ts) + "}" + let wmc: Int = engram_wm_count() + let payload: String = "{\"event\":\"heartbeat\",\"pulse\":" + pulse + ",\"boot\":" + boot + ",\"idle\":" + idle + ",\"node_count\":" + int_to_str(nc) + ",\"edge_count\":" + int_to_str(ec) + ",\"wm_active\":" + int_to_str(wmc) + ",\"ts\":" + int_to_str(ts) + "}" ise_post(payload) } diff --git a/dist/awareness.c b/dist/awareness.c index cf1df03..9fbe59e 100644 --- a/dist/awareness.c +++ b/dist/awareness.c @@ -76,8 +76,12 @@ el_val_t ise_post(el_val_t content) { el_val_t emit_heartbeat(void) { el_val_t pulse = state_get(EL_STR("soul.pulse")); el_val_t boot = state_get(EL_STR("soul_boot_count")); + el_val_t idle = int_to_str(idle_count()); el_val_t ts = time_now(); - el_val_t payload = el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(EL_STR("{\"event\":\"heartbeat\",\"pulse\":"), pulse), EL_STR(",\"boot\":")), boot), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR("}")); + el_val_t nc = engram_node_count(); + el_val_t ec = engram_edge_count(); + el_val_t wmc = engram_wm_count(); + el_val_t payload = el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(el_str_concat(EL_STR("{\"event\":\"heartbeat\",\"pulse\":"), pulse), EL_STR(",\"boot\":")), boot), EL_STR(",\"idle\":")), idle), EL_STR(",\"node_count\":")), int_to_str(nc)), EL_STR(",\"edge_count\":")), int_to_str(ec)), EL_STR(",\"wm_active\":")), int_to_str(wmc)), EL_STR(",\"ts\":")), int_to_str(ts)), EL_STR("}")); ise_post(payload); return 0; }