Change in osmo-bsc[master]: show all global counters of osmo-bsc in vty

2018-05-24 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/9217 )

Change subject: show all global counters of osmo-bsc in vty
..


Patch Set 2:

> (1 comment)

There is already a function for this purpose in in libosmocore: 
vty_out_rate_ctr_group()

But the output doesn't look as nice in this case:

OsmoBSC# show statistics
base station controller:
 Received handover attempts.:0 (0/s 0/m 0/h 0/d)
 Sent no channel available responses.:0 (0/s 0/m 0/h 0/d)
 Timeouts of timer T3103.:0 (0/s 0/m 0/h 0/d)
 Received handover completed.:0 (0/s 0/m 0/h 0/d)
 Received HO FAIL messages.:0 (0/s 0/m 0/h 0/d)
 Paging attempts for a subscriber.:0 (0/s 0/m 0/h 0/d)
 Paging request send failures because no responsible BTS was found.:0 
(0/s 0/m 0/h 0/d)
 Paging attempts with successful response.:0 (0/s 0/m 0/h 0/d)
 Connection attempts from unknown IPA CCM Unit ID.:0 (0/s 0/m 0/h 0/d)


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I58ae04e1960774d760e3ebb54a4f307c9f753655
Gerrit-Change-Number: 9217
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Thu, 24 May 2018 13:38:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bsc[master]: show all global counters of osmo-bsc in vty

2018-05-18 Thread Stefan Sperling
Stefan Sperling has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/9217 )

Change subject: show all global counters of osmo-bsc in vty
..

show all global counters of osmo-bsc in vty

The 'show statistics' VTY command was not showing all counters
maintained by osmo-bsc. Instead of printing just two counters
related to paging, print all available counters in a generic way.

Adjust descriptions of some counters for nicer display.

After startup (all counters are zero) is now looks like this:

OsmoBSC# show statistics
   handover:attempted:  0 Received handover attempts.
  handover:no_channel:  0 Sent no channel available responses.
 handover:timeout:  0 Timeouts of timer T3103.
   handover:completed:  0 Received handover completed.
  handover:failed:  0 Received HO FAIL messages.
 paging:attempted:  0 Paging attempts for a subscriber.
  paging:detached:  0 Paging request send failures because no 
responsible BTS was found.
 paging:responded:  0 Paging attempts with successful response.
OsmoBSC#

Change-Id: I58ae04e1960774d760e3ebb54a4f307c9f753655
Related: OS#3245
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_vty.c
2 files changed, 11 insertions(+), 7 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 29b97f0..6365938 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1133,12 +1133,12 @@
 static const struct rate_ctr_desc bsc_ctr_description[] = {
[BSC_CTR_HANDOVER_ATTEMPTED] =  {"handover:attempted", 
"Received handover attempts."},
[BSC_CTR_HANDOVER_NO_CHANNEL] = {"handover:no_channel", "Sent 
no channel available responses."},
-   [BSC_CTR_HANDOVER_TIMEOUT] ={"handover:timeout", "Count the 
amount of timeouts of timer T3103."},
+   [BSC_CTR_HANDOVER_TIMEOUT] ={"handover:timeout", "Timeouts 
of timer T3103."},
[BSC_CTR_HANDOVER_COMPLETED] =  {"handover:completed", 
"Received handover completed."},
-   [BSC_CTR_HANDOVER_FAILED] = {"handover:failed", "Receive HO 
FAIL messages."},
+   [BSC_CTR_HANDOVER_FAILED] = {"handover:failed", "Received 
HO FAIL messages."},

[BSC_CTR_PAGING_ATTEMPTED] ={"paging:attempted", "Paging 
attempts for a subscriber."},
-   [BSC_CTR_PAGING_DETACHED] = {"paging:detached", "Counts the 
amount of paging attempts which couldn't sent out any paging request because no 
responsible bts found."},
+   [BSC_CTR_PAGING_DETACHED] = {"paging:detached", "Paging 
request send failures because no responsible BTS was found."},
[BSC_CTR_PAGING_RESPONDED] ={"paging:responded", "Paging 
attempts with successful response."},
 };

diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index ea4c8d0..e53a14f 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -4133,12 +4133,16 @@
return CMD_SUCCESS;
 }

+int print_counter(struct rate_ctr_group *bsc_ctrs, struct rate_ctr *ctr, const 
struct rate_ctr_desc *desc, void *data)
+{
+   struct vty *vty = data;
+   vty_out(vty, "%25s: %10"PRIu64" %s%s", desc->name, ctr->current, 
desc->description, VTY_NEWLINE);
+   return 0;
+}
+
 void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net)
 {
-   vty_out(vty, "Paging  : %"PRIu64" attempted, %"PRIu64" 
responded%s",
-   net->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED].current,
-   net->bsc_ctrs->ctr[BSC_CTR_PAGING_RESPONDED].current,
-   VTY_NEWLINE);
+   rate_ctr_for_each_counter(net->bsc_ctrs, print_counter, vty);
 }

 DEFUN(drop_bts,

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I58ae04e1960774d760e3ebb54a4f307c9f753655
Gerrit-Change-Number: 9217
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 


Change in osmo-bsc[master]: show all global counters of osmo-bsc in vty

2018-05-17 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/9217 )

Change subject: show all global counters of osmo-bsc in vty
..


Patch Set 1: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/9217/1/src/libbsc/bsc_vty.c
File src/libbsc/bsc_vty.c:

https://gerrit.osmocom.org/#/c/9217/1/src/libbsc/bsc_vty.c@4143
PS1, Line 4143: void openbsc_vty_print_statistics(struct vty *vty, struct 
gsm_network *net)
We can merge this patch first, but I think it would be actually nice to have 
this as part of libosmocore.  It should be the same for all applications, as 
it's truly generic.  libosmovty depends on libosmocore, and rate_ctr are in 
libosmcoore, i.e. anyone using libosmovty should automatically get the "print 
statistics" installed.  Maybe we should call it "print rate-counters" instead, 
as this will not clash with any existing VTY commands code like this installs 
inside the applications, so we can handle this in a graceful way (old programs 
with new libosmocore, ...)



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I58ae04e1960774d760e3ebb54a4f307c9f753655
Gerrit-Change-Number: 9217
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Thu, 17 May 2018 20:11:06 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: show all global counters of osmo-bsc in vty

2018-05-17 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/9217 )

Change subject: show all global counters of osmo-bsc in vty
..


Patch Set 1: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/9217/1/src/libbsc/bsc_vty.c
File src/libbsc/bsc_vty.c:

https://gerrit.osmocom.org/#/c/9217/1/src/libbsc/bsc_vty.c@4136
PS1, Line 4136: int print_counter(struct rate_ctr_group *bsc_ctrs, struct 
rate_ctr *ctr, const struct rate_ctr_desc *desc, void *data)
(was gonna say "const" but this is adhering to rate_ctr_handler_t)



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I58ae04e1960774d760e3ebb54a4f307c9f753655
Gerrit-Change-Number: 9217
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Thu, 17 May 2018 15:41:57 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: show all global counters of osmo-bsc in vty

2018-05-17 Thread Stefan Sperling
Stefan Sperling has uploaded this change for review. ( 
https://gerrit.osmocom.org/9217


Change subject: show all global counters of osmo-bsc in vty
..

show all global counters of osmo-bsc in vty

The 'show statistics' VTY command was not showing all counters
maintained by osmo-bsc. Instead of printing just two counters
related to paging, print all available counters in a generic way.

Adjust descriptions of some counters for nicer display.

After startup (all counters are zero) is now looks like this:

OsmoBSC# show statistics
   handover:attempted:  0 Received handover attempts.
  handover:no_channel:  0 Sent no channel available responses.
 handover:timeout:  0 Timeouts of timer T3103.
   handover:completed:  0 Received handover completed.
  handover:failed:  0 Received HO FAIL messages.
 paging:attempted:  0 Paging attempts for a subscriber.
  paging:detached:  0 Paging request send failures because no 
responsible BTS was found.
 paging:responded:  0 Paging attempts with successful response.
OsmoBSC#

Change-Id: I58ae04e1960774d760e3ebb54a4f307c9f753655
Related: OS#3245
---
M include/osmocom/bsc/gsm_data.h
M src/libbsc/bsc_vty.c
2 files changed, 11 insertions(+), 7 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/17/9217/1

diff --git a/include/osmocom/bsc/gsm_data.h b/include/osmocom/bsc/gsm_data.h
index 29b97f0..6365938 100644
--- a/include/osmocom/bsc/gsm_data.h
+++ b/include/osmocom/bsc/gsm_data.h
@@ -1133,12 +1133,12 @@
 static const struct rate_ctr_desc bsc_ctr_description[] = {
[BSC_CTR_HANDOVER_ATTEMPTED] =  {"handover:attempted", 
"Received handover attempts."},
[BSC_CTR_HANDOVER_NO_CHANNEL] = {"handover:no_channel", "Sent 
no channel available responses."},
-   [BSC_CTR_HANDOVER_TIMEOUT] ={"handover:timeout", "Count the 
amount of timeouts of timer T3103."},
+   [BSC_CTR_HANDOVER_TIMEOUT] ={"handover:timeout", "Timeouts 
of timer T3103."},
[BSC_CTR_HANDOVER_COMPLETED] =  {"handover:completed", 
"Received handover completed."},
-   [BSC_CTR_HANDOVER_FAILED] = {"handover:failed", "Receive HO 
FAIL messages."},
+   [BSC_CTR_HANDOVER_FAILED] = {"handover:failed", "Received 
HO FAIL messages."},

[BSC_CTR_PAGING_ATTEMPTED] ={"paging:attempted", "Paging 
attempts for a subscriber."},
-   [BSC_CTR_PAGING_DETACHED] = {"paging:detached", "Counts the 
amount of paging attempts which couldn't sent out any paging request because no 
responsible bts found."},
+   [BSC_CTR_PAGING_DETACHED] = {"paging:detached", "Paging 
request send failures because no responsible BTS was found."},
[BSC_CTR_PAGING_RESPONDED] ={"paging:responded", "Paging 
attempts with successful response."},
 };

diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index ea4c8d0..e53a14f 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -4133,12 +4133,16 @@
return CMD_SUCCESS;
 }

+int print_counter(struct rate_ctr_group *bsc_ctrs, struct rate_ctr *ctr, const 
struct rate_ctr_desc *desc, void *data)
+{
+   struct vty *vty = data;
+   vty_out(vty, "%25s: %10"PRIu64" %s%s", desc->name, ctr->current, 
desc->description, VTY_NEWLINE);
+   return 0;
+}
+
 void openbsc_vty_print_statistics(struct vty *vty, struct gsm_network *net)
 {
-   vty_out(vty, "Paging  : %"PRIu64" attempted, %"PRIu64" 
responded%s",
-   net->bsc_ctrs->ctr[BSC_CTR_PAGING_ATTEMPTED].current,
-   net->bsc_ctrs->ctr[BSC_CTR_PAGING_RESPONDED].current,
-   VTY_NEWLINE);
+   rate_ctr_for_each_counter(net->bsc_ctrs, print_counter, vty);
 }

 DEFUN(drop_bts,

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I58ae04e1960774d760e3ebb54a4f307c9f753655
Gerrit-Change-Number: 9217
Gerrit-PatchSet: 1
Gerrit-Owner: Stefan Sperling