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

daniel gerrit-no-reply at lists.osmocom.org
Wed Jun 16 12:35:49 UTC 2021


daniel has uploaded this change for review. ( 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(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/24688/1

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: 1
Gerrit-Owner: daniel <dwillmann at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210616/69a7b14c/attachment.htm>


More information about the gerrit-log mailing list