Rework statistic collection to be per repository and add metric output option
authorclaudio <claudio@openbsd.org>
Thu, 15 Dec 2022 12:02:29 +0000 (12:02 +0000)
committerclaudio <claudio@openbsd.org>
Thu, 15 Dec 2022 12:02:29 +0000 (12:02 +0000)
commit4f5f25cbf9d7d654412dce563250c73403fab1fd
tree754b162fd1e2486f9e4515bf78b57133c18f7b61
parentfa433bfe2d0b60a3106b20b1c6cfa60a56cb7bb8
Rework statistic collection to be per repository and add metric output option

Many statistic values are now accounted by repository via repo_stat_inc()
At end of the run sum_stats() accumulates these stats per TAL and globally.
The new output file metrics is written when the -m output flag is specified.
The metrics file is written in OpenMetrics format (with a few tweaks to
allow node_exporter to parse the file as well). The ometric code is a copy
from bgpctl(8) and should be kept in sync.
OK tb@
13 files changed:
usr.sbin/rpki-client/Makefile
usr.sbin/rpki-client/aspa.c
usr.sbin/rpki-client/extern.h
usr.sbin/rpki-client/main.c
usr.sbin/rpki-client/ometric.c [new file with mode: 0644]
usr.sbin/rpki-client/ometric.h [new file with mode: 0644]
usr.sbin/rpki-client/output-json.c
usr.sbin/rpki-client/output-ometric.c [new file with mode: 0644]
usr.sbin/rpki-client/output.c
usr.sbin/rpki-client/parser.c
usr.sbin/rpki-client/repo.c
usr.sbin/rpki-client/roa.c
usr.sbin/rpki-client/rpki-client.8