From bf5a00fd1bbbcf6a64c397dd18ae0cd5ea74b3b2 Mon Sep 17 00:00:00 2001 From: Pawel Kuzak Date: Thu, 21 May 2015 11:11:12 +0200 Subject: [PATCH] Modified average_dur format for graphite. It does not really make sense to separate seconds and microseconds for the statistics. Re-Commit of 6e7a287f54cac080d552d90266033bdb57266841 which got lost somehow. --- daemon/graphite.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/daemon/graphite.c b/daemon/graphite.c index 7e64e6ea2..0d6c8edfe 100644 --- a/daemon/graphite.c +++ b/daemon/graphite.c @@ -126,9 +126,7 @@ int send_graphite_data() { mutex_unlock(&cm->totalstats_interval.total_average_lock); if (graphite_prefix!=NULL) { rc = sprintf(ptr,"%s.",graphite_prefix); ptr += rc; } - rc = sprintf(ptr,"%s.totals.average_call_dur.tv_sec %llu %llu\n",hostname, (unsigned long long) ts.total_average_call_dur.tv_sec,(unsigned long long)g_now.tv_sec); ptr += rc; - if (graphite_prefix!=NULL) { rc = sprintf(ptr,"%s.",graphite_prefix); ptr += rc; } - rc = sprintf(ptr,"%s.totals.average_call_dur.tv_usec %lu %llu\n",hostname, ts.total_average_call_dur.tv_usec,(unsigned long long)g_now.tv_sec); ptr += rc; + rc = sprintf(ptr,"%s.totals.average_call_dur %llu.%06llu %llu\n",hostname, (unsigned long long) cm->totalstats_interval.total_average_call_dur.tv_sec,(unsigned long long) cm->totalstats_interval.total_average_call_dur.tv_usec,(unsigned long long)g_now); ptr += rc; if (graphite_prefix!=NULL) { rc = sprintf(ptr,"%s.",graphite_prefix); ptr += rc; } rc = sprintf(ptr,"%s.totals.forced_term_sess "UINT64F" %llu\n",hostname, atomic64_get_na(&ts.total_forced_term_sess),(unsigned long long)g_now.tv_sec); ptr += rc; if (graphite_prefix!=NULL) { rc = sprintf(ptr,"%s.",graphite_prefix); ptr += rc; }