aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKirill Zakharenko <earwin@gmail.com>2020-04-23 17:33:12 +0300
committerKirill Zakharenko <earwin@gmail.com>2020-04-23 19:02:08 +0300
commit1405163e3da4cd5ff83e34dea4da8fee4b741f94 (patch)
treed6d292d6b6760f23fef13ba7be72e7def846a878
parentfd2677652696735d99b3ceaaec84cc694f510976 (diff)
statsd: do not omit index==0 when sending stat item groups
-rw-r--r--src/stats_statsd.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/stats_statsd.c b/src/stats_statsd.c
index c3f739e2..d4496677 100644
--- a/src/stats_statsd.c
+++ b/src/stats_statsd.c
@@ -99,24 +99,16 @@ static int osmo_stats_reporter_statsd_send(struct osmo_stats_reporter *srep,
int old_len = msgb_length(srep->buffer);
if (prefix) {
- if (name1) {
- if (index1 != 0)
- fmt = "%1$s.%2$s.%6$u.%3$s:%4$d|%5$s";
- else
- fmt = "%1$s.%2$s.%3$s:%4$d|%5$s";
- } else {
+ if (name1)
+ fmt = "%1$s.%2$s.%6$u.%3$s:%4$d|%5$s";
+ else
fmt = "%1$s.%2$0.0s%3$s:%4$d|%5$s";
- }
} else {
prefix = "";
- if (name1) {
- if (index1 != 0)
- fmt = "%1$s%2$s.%6$u.%3$s:%4$d|%5$s";
- else
- fmt = "%1$s%2$s.%3$s:%4$d|%5$s";
- } else {
+ if (name1)
+ fmt = "%1$s%2$s.%6$u.%3$s:%4$d|%5$s";
+ else
fmt = "%1$s%2$0.0s%3$s:%4$d|%5$s";
- }
}
if (srep->agg_enabled) {