MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / mi_list_stat

Function mi_list_stat

statistics.c:715–735  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

713}
714
715inline static int mi_list_stat(mi_item_t *resp_obj, str *mod, stat_var *stat)
716{
717 str tmp_buf;
718 char *buf;
719
720 if (mi_stat_name(mod, &stat->name, &tmp_buf) < 0) {
721 LM_ERR("cannot get stat name\n");
722 return -1;
723 }
724
725 if (stat->flags & (STAT_IS_FUNC|STAT_NO_RESET))
726 buf = "non-incremental";
727 else
728 buf = "incremental";
729
730 if (add_mi_string_fmt(resp_obj, tmp_buf.s, tmp_buf.len, "%s", buf)<0) {
731 LM_ERR("cannot add stat\n");
732 return -1;
733 }
734 return 0;
735}
736
737inline static int mi_add_module_stats(mi_item_t *resp_obj, module_stats *mods)
738{

Callers 2

mi_list_module_statsFunction · 0.85
w_mi_list_stats_1Function · 0.85

Calls 2

mi_stat_nameFunction · 0.85
add_mi_string_fmtFunction · 0.85

Tested by

no test coverage detected