From 8691aca94ce895a46e16ccc7d819336aece1d0e1 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Dalido Date: Mon, 13 Feb 2017 16:14:51 +0100 Subject: [PATCH] stats: add nesting around servers for easier parsing --- src/dyn_stats.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/dyn_stats.c b/src/dyn_stats.c index 47d7a0cd2..59e1a89de 100644 --- a/src/dyn_stats.c +++ b/src/dyn_stats.c @@ -802,12 +802,17 @@ stats_make_info_rsp(struct stats *st) /* copy pool metric from sum(c) to buffer */ THROW_STATUS(stats_copy_metric(st, &stp->metric, false)); + struct string stats_servers_list; + string_set_text(&stats_servers_list, "servers") + struct stats_server *sts = &stp->server; + THROW_STATUS(stats_begin_nesting(&st->buf, &stats_servers_list, false)); THROW_STATUS(stats_begin_nesting(&st->buf, &sts->name, false)); /* copy server metric from sum(c) to buffer */ THROW_STATUS(stats_copy_metric(st, &sts->metric, true)); THROW_STATUS(stats_end_nesting(&st->buf, false)); + THROW_STATUS(stats_end_nesting(&st->buf, false)); THROW_STATUS(stats_end_nesting(&st->buf, false)); THROW_STATUS(stats_add_footer(&st->buf));