]> git.ipfire.org Git - thirdparty/haproxy.git/commit
MEDIUM: stats: Add JSON output option to show (info|stat)
authorSimon Horman <horms@verge.net.au>
Wed, 4 Jan 2017 08:37:25 +0000 (09:37 +0100)
committerWilly Tarreau <w@1wt.eu>
Tue, 14 Mar 2017 10:14:03 +0000 (11:14 +0100)
commit05ee213f8b27855d0c6578ced12127e2e1196266
tree59bf30afa8ef48b2c249d8793819ba605af8fbaa
parent2019f95997d6747d6df010739476e5dccca13548
MEDIUM: stats: Add JSON output option to show (info|stat)

Add a json parameter to show (info|stat) which will output information
in JSON format. A follow-up patch will add a JSON schema which describes
the format of the JSON output of these commands.

The JSON output is without any extra whitespace in order to reduce the
volume of output. For human consumption passing the output through a
pretty printer may be helpful.

e.g.:
$ echo "show info json" | socat /var/run/haproxy.stat stdio | \
     python -m json.tool

STAT_STARTED has bee added in order to track if show output has begun or
not. This is used in order to allow the JSON output routines to only insert
a "," between elements when needed. I would value any feedback on how this
might be done better.

Signed-off-by: Simon Horman <horms@verge.net.au>
doc/management.txt
include/types/stats.h
src/stats.c