| 713 | } |
| 714 | |
| 715 | inline 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 | |
| 737 | inline static int mi_add_module_stats(mi_item_t *resp_obj, module_stats *mods) |
| 738 | { |
no test coverage detected