Browse Source

TT#156052 add call duration metric to Prom

Change-Id: I734e9d4bf08f5b5559decb546ac150bc6bf981ac
pull/1421/head
Richard Fuchs 4 years ago
parent
commit
970757da2b
2 changed files with 33 additions and 0 deletions
  1. +5
    -0
      daemon/statistics.c
  2. +28
    -0
      t/test-stats.c

+ 5
- 0
daemon/statistics.c View File

@ -464,6 +464,11 @@ GQueue *statistics_gather_metrics(void) {
METRIC("onewaystreams", "Total number of 1-way streams", UINT64F, UINT64F,atomic64_get(&rtpe_stats_cumulative.oneway_stream_sess)); METRIC("onewaystreams", "Total number of 1-way streams", UINT64F, UINT64F,atomic64_get(&rtpe_stats_cumulative.oneway_stream_sess));
PROM("one_way_sessions_total", "counter"); PROM("one_way_sessions_total", "counter");
METRICva("avgcallduration", "Average call duration", "%" TIME_T_INT_FMT ".%06" TIME_T_INT_FMT, "%" TIME_T_INT_FMT ".%06" TIME_T_INT_FMT " seconds", avg.tv_sec, avg.tv_usec); METRICva("avgcallduration", "Average call duration", "%" TIME_T_INT_FMT ".%06" TIME_T_INT_FMT, "%" TIME_T_INT_FMT ".%06" TIME_T_INT_FMT " seconds", avg.tv_sec, avg.tv_usec);
PROM("call_duration_avg", "gauge");
calls_dur_iv = (double) total_duration / 1000000.0;
METRICva("totalcallsduration", "Total calls duration", "%.6f", "%.6f seconds", calls_dur_iv);
PROM("call_duration_total", "counter");
calls_dur_iv = (double) atomic64_get_na(&rtpe_stats_graphite_interval.total_calls_duration_intv) / 1000000.0; calls_dur_iv = (double) atomic64_get_na(&rtpe_stats_graphite_interval.total_calls_duration_intv) / 1000000.0;
min_sess_iv = atomic64_get(&rtpe_stats_gauge_graphite_min_max_interval.min.total_sessions); min_sess_iv = atomic64_get(&rtpe_stats_gauge_graphite_min_max_interval.min.total_sessions);


+ 28
- 0
t/test-stats.c View File

@ -430,6 +430,10 @@ int main(void) {
"avgcallduration\n" "avgcallduration\n"
"0.000000 seconds\n" "0.000000 seconds\n"
"0.000000\n" "0.000000\n"
"Total calls duration\n"
"totalcallsduration\n"
"0.000000 seconds\n"
"0.000000\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -1268,6 +1272,10 @@ int main(void) {
"avgcallduration\n" "avgcallduration\n"
"0.000000 seconds\n" "0.000000 seconds\n"
"0.000000\n" "0.000000\n"
"Total calls duration\n"
"totalcallsduration\n"
"0.000000 seconds\n"
"0.000000\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -2103,6 +2111,10 @@ int main(void) {
"avgcallduration\n" "avgcallduration\n"
"0.000000 seconds\n" "0.000000 seconds\n"
"0.000000\n" "0.000000\n"
"Total calls duration\n"
"totalcallsduration\n"
"0.000000 seconds\n"
"0.000000\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -2951,6 +2963,10 @@ int main(void) {
"avgcallduration\n" "avgcallduration\n"
"0.000000 seconds\n" "0.000000 seconds\n"
"0.000000\n" "0.000000\n"
"Total calls duration\n"
"totalcallsduration\n"
"0.000000 seconds\n"
"0.000000\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -3794,6 +3810,10 @@ int main(void) {
"avgcallduration\n" "avgcallduration\n"
"0.000000 seconds\n" "0.000000 seconds\n"
"0.000000\n" "0.000000\n"
"Total calls duration\n"
"totalcallsduration\n"
"0.000000 seconds\n"
"0.000000\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -4632,6 +4652,10 @@ int main(void) {
"avgcallduration\n" "avgcallduration\n"
"0.000000 seconds\n" "0.000000 seconds\n"
"0.000000\n" "0.000000\n"
"Total calls duration\n"
"totalcallsduration\n"
"0.000000 seconds\n"
"0.000000\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"
@ -5472,6 +5496,10 @@ int main(void) {
"avgcallduration\n" "avgcallduration\n"
"93.000000 seconds\n" "93.000000 seconds\n"
"93.000000\n" "93.000000\n"
"Total calls duration\n"
"totalcallsduration\n"
"186.000000 seconds\n"
"186.000000\n"
"\n" "\n"
"\n" "\n"
"}\n" "}\n"


Loading…
Cancel
Save