From d7f09738fdd9e3615f10f4f70352d726e64d9e20 Mon Sep 17 00:00:00 2001 From: job Date: Thu, 8 Apr 2021 19:49:27 +0000 Subject: [PATCH] Expose two extra metrics via JSON This removes some of the needs of rpki-client affiniadios who screen-scrape rpki-client's STDOUT. OK deraadt@ --- usr.sbin/rpki-client/output-json.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.sbin/rpki-client/output-json.c b/usr.sbin/rpki-client/output-json.c index 94fa6026d21..fd2faa8548f 100644 --- a/usr.sbin/rpki-client/output-json.c +++ b/usr.sbin/rpki-client/output-json.c @@ -1,4 +1,4 @@ -/* $OpenBSD: output-json.c,v 1.14 2020/12/09 11:29:04 claudio Exp $ */ +/* $OpenBSD: output-json.c,v 1.15 2021/04/08 19:49:27 job Exp $ */ /* * Copyright (c) 2019 Claudio Jeker * @@ -58,7 +58,9 @@ outputheader_json(FILE *out, struct stats *st) "\t\t\"gbrs\": %zu,\n" "\t\t\"repositories\": %zu,\n" "\t\t\"vrps\": %zu,\n" - "\t\t\"uniquevrps\": %zu\n" + "\t\t\"uniquevrps\": %zu,\n" + "\t\t\"cachedir_del_files\": %zu,\n" + "\t\t\"cachedir_del_dirs\": %zu\n" "\t},\n\n", hn, tbuf, (long long)st->elapsed_time.tv_sec, (long long)st->user_time.tv_sec, (long long)st->system_time.tv_sec, @@ -69,7 +71,8 @@ outputheader_json(FILE *out, struct stats *st) st->crls, st->gbrs, st->repos, - st->vrps, st->uniqs) < 0) + st->vrps, st->uniqs, + st->del_files, st->del_dirs) < 0) return -1; return 0; } -- 2.20.1