MCPcopy Create free account
hub / github.com/corosync/corosync / load_update_stats_fn

Function load_update_stats_fn

exec/mon.c:388–411  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

386}
387
388static void load_update_stats_fn (void *data)
389{
390 struct resource_instance * inst = (struct resource_instance *)data;
391 uint64_t timestamp;
392 char key_name[ICMAP_KEYNAME_MAXLEN];
393 double min15 = min15_loadavg_get();
394
395 if (min15 > 0) {
396 snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", inst->icmap_path, "current");
397 icmap_set_double(key_name, min15);
398
399 timestamp = cs_timestamp_get();
400
401 snprintf(key_name, ICMAP_KEYNAME_MAXLEN, "%s%s", inst->icmap_path, "last_updated");
402 icmap_set_uint64(key_name, timestamp);
403
404 if (min15 > inst->max.dbl && inst->fsm.curr_state != MON_S_FAILED) {
405 cs_fsm_process (&inst->fsm, MON_E_FAILURE, inst, mon_fsm_cb);
406 }
407 }
408
409 api->timer_add_duration(inst->period * MILLI_2_NANO_SECONDS,
410 inst, inst->update_stats_fn, &inst->timer_handle);
411}
412
413static void mon_key_changed_cb (
414 int32_t event,

Callers

nothing calls this directly

Calls 5

min15_loadavg_getFunction · 0.85
icmap_set_doubleFunction · 0.85
cs_timestamp_getFunction · 0.85
icmap_set_uint64Function · 0.85
cs_fsm_processFunction · 0.85

Tested by

no test coverage detected