diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-22 16:02:13 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-01-22 16:22:18 +0100 |
commit | 51b9e7a396be16a8fda47d2fd891c72db7f4f4d0 (patch) | |
tree | 99541f74eee61ff0af8016d04930ef29c60f5c86 /src | |
parent | 4c1eb0ee43259bae710b5685ed666210be9712f9 (diff) |
stats: Implement VTY command to dump the linksets
Diffstat (limited to 'src')
-rw-r--r-- | src/vty_interface.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/src/vty_interface.c b/src/vty_interface.c index 0cf5929..83d33c8 100644 --- a/src/vty_interface.c +++ b/src/vty_interface.c @@ -23,6 +23,7 @@ #include <osmocore/talloc.h> #include <osmocore/gsm48.h> +#include <osmocore/rate_ctr.h> #include <osmocom/vty/command.h> #include <osmocom/vty/vty.h> @@ -275,6 +276,30 @@ DEFUN(cfg_lac, cfg_lac_cmd, return CMD_SUCCESS; } +static void dump_stats(struct vty *vty, struct mtp_link_set *set) +{ + struct mtp_link *link; + + vty_out(vty, "Linkset opc: %d%s", set->opc, VTY_NEWLINE); + vty_out_rate_ctr_group(vty, " ", set->ctrg); + + llist_for_each_entry(link, &set->links, entry) { + vty_out(vty, " Link %d%s", link->link_no, VTY_NEWLINE); + vty_out_rate_ctr_group(vty, " ", link->ctrg); + } +} + +DEFUN(show_stats, show_stats_cmd, + "show statistics", + SHOW_STR "Display Linkset statistics\n") +{ + if (bsc.link_set) + dump_stats(vty, bsc.link_set); + if (bsc.m2ua_set) + dump_stats(vty, bsc.m2ua_set); + return CMD_SUCCESS; +} + void cell_vty_init(void) { cmd_init(1); @@ -303,6 +328,10 @@ void cell_vty_init(void) install_element(CELLMGR_NODE, &cfg_mcc_cmd); install_element(CELLMGR_NODE, &cfg_mnc_cmd); install_element(CELLMGR_NODE, &cfg_lac_cmd); + + + /* show commands */ + install_element_ve(&show_stats_cmd); } const char *openbsc_copyright = ""; |