Change in libosmocore[master]: stats_vty: Improve generation of osmo counters

laforge gerrit-no-reply at lists.osmocom.org
Wed Jun 16 20:39:06 UTC 2021


laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/24688 )

Change subject: stats_vty: Improve generation of osmo counters
......................................................................

stats_vty: Improve generation of osmo counters

Use section for all counter headings, the idea is that the generated doc
is included below a chapter describing the implemented counters which
can optionally describe individual items.

If not osmo_counters are present simply omit the whole section to tidy
up the manual. Those are deprecated anyway and not used in the osmo-*
projects that I checked.

Change-Id: I126b39cb9458e0f62efa338967e07151a0eece0f
Related: SYS#5005, OS#4523
---
M src/vty/stats_vty.c
1 file changed, 10 insertions(+), 11 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c
index d5d3292..ba45e1e 100644
--- a/src/vty/stats_vty.c
+++ b/src/vty/stats_vty.c
@@ -415,13 +415,6 @@
 
 static void asciidoc_counter_generate(struct vty *vty)
 {
-	if (osmo_counters_count() == 0)
-	{
-		vty_out(vty, "// there are no ungrouped osmo_counters%s",
-			VTY_NEWLINE);
-		return;
-	}
-
 	vty_out(vty, "// ungrouped osmo_counters%s", VTY_NEWLINE);
 	vty_out(vty, ".ungrouped osmo counters%s", VTY_NEWLINE);
 	vty_out(vty, "[options=\"header\"]%s", VTY_NEWLINE);
@@ -542,13 +535,19 @@
 	vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE);
 	rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty);
 
-	vty_out(vty, "== Osmo Stat Items%s%s", VTY_NEWLINE, VTY_NEWLINE);
+	vty_out(vty, "=== Osmo Stat Items%s%s", VTY_NEWLINE, VTY_NEWLINE);
 	vty_out(vty, "// generating tables for osmo_stat_items%s", VTY_NEWLINE);
 	osmo_stat_item_for_each_group(asciidoc_osmo_stat_item_group_handler, vty);
 
-	vty_out(vty, "== Osmo Counters%s%s", VTY_NEWLINE, VTY_NEWLINE);
-	vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE);
-	asciidoc_counter_generate(vty);
+	if (osmo_counters_count() == 0)
+	{
+		vty_out(vty, "// there are no ungrouped osmo_counters%s",
+			VTY_NEWLINE);
+	} else {
+		vty_out(vty, "=== Osmo Counters%s%s", VTY_NEWLINE, VTY_NEWLINE);
+		vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE);
+		asciidoc_counter_generate(vty);
+	}
 	return CMD_SUCCESS;
 }
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/24688
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I126b39cb9458e0f62efa338967e07151a0eece0f
Gerrit-Change-Number: 24688
Gerrit-PatchSet: 2
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge at osmocom.org>
Gerrit-Reviewer: lynxis lazus <lynxis at fe80.eu>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210616/00a3cd37/attachment.htm>


More information about the gerrit-log mailing list