From 210d371b8949a08afe74ec7beb98aa9b89d4e00e Mon Sep 17 00:00:00 2001 From: xchaos Date: Mon, 18 Nov 2013 23:33:41 +0000 Subject: [PATCH] packet counters in json output git-svn-id: https://dev.arachne.cz/repos/prometheus/trunk@234 251d49ef-1d17-4917-a970-b30cf55b089b --- json.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/json.c b/json.c index 0d8b514..c04a568 100644 --- a/json.c +++ b/json.c @@ -23,11 +23,12 @@ void write_json_traffic(char *json) fprintf(f, ",\n"); } fprintf(f, - " \"%s\":{ \"lms\": %d, \"ip\":\"%s\", \"total\":%Lu, \"down\":%Lu, \"proxy\":%Lu, \"up\":%Lu, \ -\"min\":%d, \"max\":%d, \"limit\":%d, \"realquota\":%Lu, \"credit\":%Lu, \"dailyquota\":%ld }", - ip->name, ip->lmsid, ip->addr, ip->traffic, ip->direct, ip->proxy, ip->upload, - ip->min, ip->desired, ip->max, ip->realquota, ip->credit, - (ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))); + " \"%s\":{ \"lms\": %d, \"ip\":\"%s\", \"total\":%Lu, \"down\":%Lu, \ + \"proxy\":%Lu, \"up\":%Lu, \"min\":%d, \"max\":%d, \"limit\":%d, \ + \"pktsup\":%Lu, \"pktsdown\":%Lu, \"realquota\":%Lu, \"credit\":%Lu, \"dailyquota\":%ld }", + ip->name, ip->lmsid, ip->addr, ip->traffic, ip->direct, ip->proxy, + ip->upload, ip->min, ip->desired, ip->max, ip->pktsup, ip->pktsdown, + ip->realquota, ip->credit, (ip->min*ip->keyword->data_limit+(ip->keyword->fixed_limit<<20))); jsoncount++; } } -- 2.30.2