libosmocore[master]: vty: show asciidoc counters: don't create an empty table for...

2017-12-05 Thread Harald Welte

Patch Set 1: Code-Review+2

-- 
To view, visit https://gerrit.osmocom.org/5190
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie2768100e69dcd7d8d77533688585dd9b43c4a5e
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[MERGED] libosmocore[master]: vty: show asciidoc counters: don't create an empty table for...

2017-12-05 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: vty: show asciidoc counters: don't create an empty table for 
osmo_counters
..


vty: show asciidoc counters: don't create an empty table for osmo_counters

When creating asciidocs for osmo_counter an empty is not useful.
If there aren't any counter, output a hidden comment
Change-Id: Ie2768100e69dcd7d8d77533688585dd9b43c4a5e
---
M src/vty/stats_vty.c
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Max: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c
index 6c09c38..faa136d 100644
--- a/src/vty/stats_vty.c
+++ b/src/vty/stats_vty.c
@@ -393,6 +393,13 @@
 
 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);

-- 
To view, visit https://gerrit.osmocom.org/5190
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie2768100e69dcd7d8d77533688585dd9b43c4a5e
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


libosmocore[master]: vty: show asciidoc counters: don't create an empty table for...

2017-12-05 Thread Max

Patch Set 1: Code-Review+1

-- 
To view, visit https://gerrit.osmocom.org/5190
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie2768100e69dcd7d8d77533688585dd9b43c4a5e
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 
Gerrit-HasComments: No


[PATCH] libosmocore[master]: vty: show asciidoc counters: don't create an empty table for...

2017-12-05 Thread lynxis lazus

Review at  https://gerrit.osmocom.org/5190

vty: show asciidoc counters: don't create an empty table for osmo_counters

When creating asciidocs for osmo_counter an empty is not useful.
If there aren't any counter, output a hidden comment
Change-Id: Ie2768100e69dcd7d8d77533688585dd9b43c4a5e
---
M src/vty/stats_vty.c
1 file changed, 7 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/90/5190/1

diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c
index 6c09c38..faa136d 100644
--- a/src/vty/stats_vty.c
+++ b/src/vty/stats_vty.c
@@ -393,6 +393,13 @@
 
 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);

-- 
To view, visit https://gerrit.osmocom.org/5190
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie2768100e69dcd7d8d77533688585dd9b43c4a5e
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus