summaryrefslogtreecommitdiff
path: root/res/res_chan_stats.c
diff options
context:
space:
mode:
authortcambron <tcambron@digium.com>2015-12-09 09:48:29 -0600
committerKevin Harwell <kharwell@digium.com>2015-12-09 12:48:51 -0600
commit5790700497972687dd79567acd89b27c90a86a22 (patch)
tree03ddbbd6189fd99f1867b404d1b0af42c93a603d /res/res_chan_stats.c
parent48c065e46db8c8f9301ee0220229a58c43f958ec (diff)
res_chan_stats: Fix bug to send correct statistics to StatsD
Fixed a bug that originally would show a negative number of active calls occuring in Asterisk. A gauge is persistent so incrementing and decrementing it results in a more consistent performance. Also changed to the call to StatsD to use ast_statsd_log_string() so that a "+" could be sent to StatsD. ASTERISK-25619 #close Change-Id: Iaaeff5c4c6a46535366b4d16ea0ed0ee75ab2ee7
Diffstat (limited to 'res/res_chan_stats.c')
-rw-r--r--res/res_chan_stats.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/res/res_chan_stats.c b/res/res_chan_stats.c
index 8b188dc13..dfca39a8b 100644
--- a/res/res_chan_stats.c
+++ b/res/res_chan_stats.c
@@ -111,7 +111,7 @@ static void updates(void *data, struct stasis_subscription *sub,
if (!update->old_snapshot && update->new_snapshot) {
/* Initial cache entry; count a channel creation */
- ast_statsd_log("channels.count", AST_STATSD_COUNTER, 1);
+ ast_statsd_log_string("channels.count", AST_STATSD_GAUGE, "+1", 1.0);
} else if (update->old_snapshot && !update->new_snapshot) {
/* Cache entry removed. Compute the age of the channel and post
* that, as well as decrementing the channel count.
@@ -125,7 +125,7 @@ static void updates(void *data, struct stasis_subscription *sub,
ast_statsd_log("channels.calltime", AST_STATSD_TIMER, age);
/* And decrement the channel count */
- ast_statsd_log("channels.count", AST_STATSD_COUNTER, -1);
+ ast_statsd_log_string("channels.count", AST_STATSD_GAUGE, "-1", 1.0);
}
}