mirror of https://gerrit.osmocom.org/libosmocore
statsd: fix rendering for groups with idx==0
while skipping `0` might be visually pleasant for non-repeating groups, e.g.: bsc.assignment.completed it makes metrics parsing very awkward for repeating groups, e.g.: bts.chreq.total bts.1.chreq.total bts.2.chreq.total and since nobody's going to look at raw statsd stream anyway, we can live with some extra zeroes Change-Id: Id294202fbcebe0b6b155c7f267b2da73af20adf4
This commit is contained in:
parent
f5bdef4efd
commit
0ae0fa1623
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue