MEDIUM: stats: implement a typed output format for stats
The output for each field is :
field:<origin><nature><scope>:type:value
where field reminds the type of the object being dumped as well as its
position (pid, iid, sid), field number and field name. This way a
monitoring utility may very well report all available information without
knowing new fields in advance.
This format is also supported in the HTTP version of the stats by adding
";typed" after the URI, instead of ";csv" for the CSV format.
The doc was not updated yet.
diff --git a/src/proto_http.c b/src/proto_http.c
index 79f92b9..8b5caad 100644
--- a/src/proto_http.c
+++ b/src/proto_http.c
@@ -3086,6 +3086,14 @@
}
}
+ for (h = lookup; h <= uri + msg->sl.rq.u_l - 6; h++) {
+ if (memcmp(h, ";typed", 6) == 0) {
+ appctx->ctx.stats.flags &= ~STAT_FMT_HTML;
+ appctx->ctx.stats.flags |= STAT_FMT_TYPED;
+ break;
+ }
+ }
+
for (h = lookup; h <= uri + msg->sl.rq.u_l - 8; h++) {
if (memcmp(h, ";st=", 4) == 0) {
int i;