OpenBSD CVS

CVS log for src/usr.sbin/bgpctl/ometric.c


[BACK] Up to [local] / src / usr.sbin / bgpctl

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.10 / (download) - annotate - [select for diffs], Fri Jan 6 13:26:57 2023 UTC (17 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, HEAD
Changes since 1.9: +2 -2 lines
Diff to previous 1.9 (colored)

sync with rpki-client 'more dastardly white spaces' commit

Revision 1.9 / (download) - annotate - [select for diffs], Wed Dec 14 11:23:41 2022 UTC (17 months, 3 weeks ago) by claudio
Branch: MAIN
Changes since 1.8: +3 -1 lines
Diff to previous 1.8 (colored)

Add missing type for OMT_INFO.

Changes output like this:
 # HELP bgpd bgpd information
-# TYPE bgpd unknown
+# TYPE bgpd info
 bgpd_info{nodename="xxx",domainname="xxx",release="7.7"} 1

Revision 1.8 / (download) - annotate - [select for diffs], Mon Dec 12 09:51:04 2022 UTC (17 months, 4 weeks ago) by claudio
Branch: MAIN
Changes since 1.7: +12 -12 lines
Diff to previous 1.7 (colored)

Since bgpctl uses clock_gettime() and struct timespec switch ometric code
over to handle struct timespec instead of struct timeval. This way no
extra conversion is needed.
OK tb@

Revision 1.7 / (download) - annotate - [select for diffs], Tue Dec 6 17:38:41 2022 UTC (18 months ago) by claudio
Branch: MAIN
Changes since 1.6: +61 -3 lines
Diff to previous 1.6 (colored)

OpenMetrics is rather strict about naming metricsets.
Add a function that a) verifies that none of the special suffixes is used
and b) that the name itself is not yet used already.
Also when printing a counter _total has to be added to the metric name and
for info metrics _info is added.
With and OK tb@

Revision 1.6 / (download) - annotate - [select for diffs], Tue Dec 6 11:27:58 2022 UTC (18 months ago) by claudio
Branch: MAIN
Changes since 1.5: +40 -1 lines
Diff to previous 1.5 (colored)

Implement ometric_set_timeval() and ometric_set_timeval_with_labels()

Timestamps are special since they can require more significant bits
than a double provides. Instead print them as pseudo float as suggested
by the OpenMetrics draft.
OK cheloha@

Revision 1.5 / (download) - annotate - [select for diffs], Mon Dec 5 11:50:11 2022 UTC (18 months ago) by claudio
Branch: MAIN
Changes since 1.4: +6 -3 lines
Diff to previous 1.4 (colored)

Revert and adjust the changes in ometric_set_state() from last commit.
Calling ometric_set_int_with_labels() for a state metric fails because
there is a check in ometric_set_int comparing the type.
Use olabels_add_extras() and ometric_set_int_value() instead.

Revision 1.4 / (download) - annotate - [select for diffs], Thu Dec 1 09:14:40 2022 UTC (18 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.3: +9 -18 lines
Diff to previous 1.3 (colored)

Extend and rename ometric_set_int_with_label to ometric_set_int_with_labels

Instead of passing a single key value pair allow for multiple keys and values.
This is needed for rpki-client where 2 extra key value pairs are needed for
some values. To simplify passing simple values introduce a OKV() macro
which creates a compound literal array with the NULL terminal.
OK tb@

Revision 1.3 / (download) - annotate - [select for diffs], Wed Nov 30 10:15:01 2022 UTC (18 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.2: +36 -25 lines
Diff to previous 1.2 (colored)

Pass a FILE pointer to ometric_output_all() and use fprintf() instead of
printing to stdout by default. Additionally check if fprintf() fails and
return -1 in that case. With this ometric code can be used in rpki-client.
OK tb@

Revision 1.2 / (download) - annotate - [select for diffs], Tue Nov 1 13:35:09 2022 UTC (19 months, 1 week ago) by claudio
Branch: MAIN
Changes since 1.1: +3 -3 lines
Diff to previous 1.1 (colored)

Use unsigned long long to store integer value. At least that can always
be printed with %llu unlike uint64_t.

Revision 1.1 / (download) - annotate - [select for diffs], Mon Oct 17 12:01:19 2022 UTC (19 months, 3 weeks ago) by claudio
Branch: MAIN

Implement openmetric output via bgpctl show metric command

This adds most of the generic code to output the metrics with labels
and implements some basic metrics. The code works but metrics may still
change.

OK tb@

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.