From af5bad5ed00f0d21617c34f0e4e96eb2fd977a02 Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Fri, 27 Nov 2015 18:54:58 +0100 Subject: stat: Explicitly support stat_items without unit Add OSMO_STAT_ITEM_NO_UNIT for stat items without an unit. The statsd reporter uses gauges ("g") to report them. Sponsored-by: On-Waves ehf --- src/vty/utils.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/vty') diff --git a/src/vty/utils.c b/src/vty/utils.c index b15c8d84..3a0f138b 100644 --- a/src/vty/utils.c +++ b/src/vty/utils.c @@ -87,11 +87,14 @@ static int osmo_stat_item_handler( { struct vty_out_context *vctx = vctx_; struct vty *vty = vctx->vty; + const char *unit = + item->desc->unit != OSMO_STAT_ITEM_NO_UNIT ? + item->desc->unit : ""; vty_out(vty, " %s%s: %8" PRIi32 " %s%s", vctx->prefix, item->desc->description, osmo_stat_item_get_last(item), - item->desc->unit, VTY_NEWLINE); + unit, VTY_NEWLINE); return 0; } -- cgit v1.2.3