<p>daniel has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.osmocom.org/c/libosmocore/+/24688">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">stats_vty: Improve generation of osmo counters<br><br>Use section for all counter headings, the idea is that the generated doc<br>is included below a chapter describing the implemented counters which<br>can optionally describe individual items.<br><br>If not osmo_counters are present simply omit the whole section to tidy<br>up the manual. Those are deprecated anyway and not used in the osmo-*<br>projects that I checked.<br><br>Change-Id: I126b39cb9458e0f62efa338967e07151a0eece0f<br>Related: SYS#5005, OS#4523<br>---<br>M src/vty/stats_vty.c<br>1 file changed, 10 insertions(+), 11 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/24688/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/src/vty/stats_vty.c b/src/vty/stats_vty.c</span><br><span>index d5d3292..ba45e1e 100644</span><br><span>--- a/src/vty/stats_vty.c</span><br><span>+++ b/src/vty/stats_vty.c</span><br><span>@@ -415,13 +415,6 @@</span><br><span> </span><br><span> static void asciidoc_counter_generate(struct vty *vty)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-   if (osmo_counters_count() == 0)</span><br><span style="color: hsl(0, 100%, 40%);">- {</span><br><span style="color: hsl(0, 100%, 40%);">-               vty_out(vty, "// there are no ungrouped osmo_counters%s",</span><br><span style="color: hsl(0, 100%, 40%);">-                     VTY_NEWLINE);</span><br><span style="color: hsl(0, 100%, 40%);">-           return;</span><br><span style="color: hsl(0, 100%, 40%);">- }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span>    vty_out(vty, "// ungrouped osmo_counters%s", VTY_NEWLINE);</span><br><span>         vty_out(vty, ".ungrouped osmo counters%s", VTY_NEWLINE);</span><br><span>   vty_out(vty, "[options=\"header\"]%s", VTY_NEWLINE);</span><br><span>@@ -542,13 +535,19 @@</span><br><span>     vty_out(vty, "// generating tables for rate_ctr_group%s", VTY_NEWLINE);</span><br><span>    rate_ctr_for_each_group(asciidoc_rate_ctr_group_handler, vty);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-      vty_out(vty, "== Osmo Stat Items%s%s", VTY_NEWLINE, VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+   vty_out(vty, "=== Osmo Stat Items%s%s", VTY_NEWLINE, VTY_NEWLINE);</span><br><span>         vty_out(vty, "// generating tables for osmo_stat_items%s", VTY_NEWLINE);</span><br><span>   osmo_stat_item_for_each_group(asciidoc_osmo_stat_item_group_handler, vty);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-  vty_out(vty, "== Osmo Counters%s%s", VTY_NEWLINE, VTY_NEWLINE);</span><br><span style="color: hsl(0, 100%, 40%);">-       vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE);</span><br><span style="color: hsl(0, 100%, 40%);">-        asciidoc_counter_generate(vty);</span><br><span style="color: hsl(120, 100%, 40%);">+       if (osmo_counters_count() == 0)</span><br><span style="color: hsl(120, 100%, 40%);">+       {</span><br><span style="color: hsl(120, 100%, 40%);">+             vty_out(vty, "// there are no ungrouped osmo_counters%s",</span><br><span style="color: hsl(120, 100%, 40%);">+                   VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+ } else {</span><br><span style="color: hsl(120, 100%, 40%);">+              vty_out(vty, "=== Osmo Counters%s%s", VTY_NEWLINE, VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+            vty_out(vty, "// generating tables for osmo_counters%s", VTY_NEWLINE);</span><br><span style="color: hsl(120, 100%, 40%);">+              asciidoc_counter_generate(vty);</span><br><span style="color: hsl(120, 100%, 40%);">+       }</span><br><span>    return CMD_SUCCESS;</span><br><span> }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.osmocom.org/c/libosmocore/+/24688">change 24688</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.osmocom.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.osmocom.org/c/libosmocore/+/24688"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: libosmocore </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I126b39cb9458e0f62efa338967e07151a0eece0f </div>
<div style="display:none"> Gerrit-Change-Number: 24688 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: daniel <dwillmann@sysmocom.de> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>