Loading...
Searching...
No Matches
stats_vty.c File Reference

VTY interface for statsd / statistic items. More...

`#include <stdlib.h>`
`#include <string.h>`
`#include "config.h"`
`#include <osmocom/vty/command.h>`
`#include <osmocom/vty/buffer.h>`
`#include <osmocom/vty/vty.h>`
`#include <osmocom/vty/telnet_interface.h>`
`#include <osmocom/vty/misc.h>`
`#include <osmocom/core/stats.h>`
`#include <osmocom/core/counter.h>`
`#include <osmocom/core/rate_ctr.h>`
`#include <osmocom/core/stats_tcp.h>`

## Data Structures

struct | rctr_vty_ctx

## Macros

#define | CFG_STATS_STR "Configure stats sub-system\n"
#define | CFG_REPORTER_STR "Configure a stats reporter\n"
#define | SHOW_STATS_STR "Show statistical values\n"
#define | SKIP_ZERO_STR "Skip items with total count zero\n"
#define | STATS_STR "Stats related commands\n"

## Functions

static struct osmo_stats_reporter * | osmo_stats_vty2srep (struct vty *vty)
static int | set_srep_parameter_str (struct vty *vty, int(*fun)(struct osmo_stats_reporter *, const char *), const char *val, const char *param_name)
static int | set_srep_parameter_int (struct vty *vty, int(*fun)(struct osmo_stats_reporter *, int), const char *val, const char *param_name)
| DEFUN (cfg_stats_reporter_local_ip, cfg_stats_reporter_local_ip_cmd, "local-ip ADDR", "Set the IP address to which we bind locally\n" "IP Address\n")
| DEFUN (cfg_no_stats_reporter_local_ip, cfg_no_stats_reporter_local_ip_cmd, "no local-ip", NO_STR "Set the IP address to which we bind locally\n")
| DEFUN (cfg_stats_reporter_remote_ip, cfg_stats_reporter_remote_ip_cmd, "remote-ip ADDR", "Set the remote IP address to which we connect\n" "IP Address\n")
| DEFUN (cfg_stats_reporter_remote_port, cfg_stats_reporter_remote_port_cmd, "remote-port <1-65535>", "Set the remote port to which we connect\n" "Remote port number\n")
| DEFUN (cfg_stats_reporter_mtu, cfg_stats_reporter_mtu_cmd, "mtu <100-65535>", "Set the maximum packet size\n" "Size in byte\n")
| DEFUN (cfg_no_stats_reporter_mtu, cfg_no_stats_reporter_mtu_cmd, "no mtu", NO_STR "Set the maximum packet size\n")
| DEFUN (cfg_stats_reporter_prefix, cfg_stats_reporter_prefix_cmd, "prefix PREFIX", "Set the item name prefix\n" "The prefix string\n")
| DEFUN (cfg_no_stats_reporter_prefix, cfg_no_stats_reporter_prefix_cmd, "no prefix", NO_STR "Set the item name prefix\n")
| DEFUN (cfg_stats_reporter_level, cfg_stats_reporter_level_cmd, "level (global|peer|subscriber)", "Set the maximum group level\n" "Report global groups only\n" "Report global and network peer related groups\n" "Report global, peer, and subscriber groups\n")
| DEFUN (cfg_stats_reporter_enable, cfg_stats_reporter_enable_cmd, "enable", "Enable the reporter\n")
| DEFUN (cfg_stats_reporter_disable, cfg_stats_reporter_disable_cmd, "disable", "Disable the reporter\n")
| DEFUN (cfg_stats_reporter_flush_period, cfg_stats_reporter_flush_period_cmd, "flush-period <0-65535>", CFG_STATS_STR "Send all stats even if they have not changed (i.e. force the flush)" "every N-th reporting interval. Set to 0 to disable regular flush (default).\n" "0 to disable regular flush (default), 1 to flush every time, 2 to flush every 2nd time, etc\n")
| DEFUN (cfg_stats_reporter_statsd, cfg_stats_reporter_statsd_cmd, "stats reporter statsd [NAME]", CFG_STATS_STR CFG_REPORTER_STR "Report to a STATSD server\n" "Name of the reporter\n")
| DEFUN (cfg_no_stats_reporter_statsd, cfg_no_stats_reporter_statsd_cmd, "no stats reporter statsd [NAME]", NO_STR CFG_STATS_STR CFG_REPORTER_STR "Report to a STATSD server\n" "Name of the reporter\n")
| DEFUN (cfg_stats_reporter_log, cfg_stats_reporter_log_cmd, "stats reporter log [NAME]", CFG_STATS_STR CFG_REPORTER_STR "Report to the logger\n" "Name of the reporter\n")
| DEFUN (cfg_no_stats_reporter_log, cfg_no_stats_reporter_log_cmd, "no stats reporter log [NAME]", NO_STR CFG_STATS_STR CFG_REPORTER_STR "Report to the logger\n" "Name of the reporter\n")
| DEFUN (cfg_stats_interval, cfg_stats_interval_cmd, "stats interval <0-65535>", CFG_STATS_STR "Set the reporting interval\n" "Interval in seconds (0 disables the reporting interval)\n")
| DEFUN (cfg_tcp_stats_interval, cfg_tcp_stats_interval_cmd, "stats-tcp interval <0-65535>", CFG_STATS_STR "Set the tcp socket stats polling interval\n" "Interval in seconds (0 disables the polling interval)\n")
| DEFUN (cfg_tcp_stats_batch_size, cfg_tcp_stats_batch_size_cmd, "stats-tcp batch-size <1-65535>", CFG_STATS_STR "Set the number of tcp sockets that are processed per stats polling interval\n" "Number of sockets per interval\n")
| DEFUN (show_stats, show_stats_cmd, "show stats [skip-zero]", SHOW_STR SHOW_STATS_STR SKIP_ZERO_STR)
| DEFUN (show_stats_level, show_stats_level_cmd, "show stats level (global|peer|subscriber) [skip-zero]", SHOW_STR SHOW_STATS_STR "Set the maximum group level\n" "Show global groups only\n" "Show global and network peer related groups\n" "Show global, peer, and subscriber groups\n" SKIP_ZERO_STR)
static int | asciidoc_handle_counter (struct osmo_counter *counter, void *sctx_)
static void | asciidoc_counter_generate (struct vty *vty)
static int | asciidoc_rate_ctr_handler (struct rate_ctr_group *ctrg, struct rate_ctr *ctr, const struct rate_ctr_desc *desc, void *sctx_)
static int | asciidoc_rate_ctr_group_handler (struct rate_ctr_group *ctrg, void *sctx_)
static int | asciidoc_osmo_stat_item_handler (struct osmo_stat_item_group *statg, struct osmo_stat_item *item, void *sctx_)
static int | asciidoc_osmo_stat_item_group_handler (struct osmo_stat_item_group *statg, void *sctx_)
| DEFUN (show_stats_asciidoc_table, show_stats_asciidoc_table_cmd, "show asciidoc counters", SHOW_STR "Asciidoc generation\n" "Generate table of all registered counters\n")
static int | rate_ctr_group_handler (struct rate_ctr_group *ctrg, void *sctx_)
| DEFUN (show_rate_counters, show_rate_counters_cmd, "show rate-counters [skip-zero]", SHOW_STR "Show all rate counters\n" SKIP_ZERO_STR)
| DEFUN (stats_report, stats_report_cmd, "stats report", STATS_STR "Manurally trigger reporting of stats\n")
static int | reset_rate_ctr_group_handler (struct rate_ctr_group *ctrg, void *sctx_)
| DEFUN (stats_reset, stats_reset_cmd, "stats reset", STATS_STR "Reset all rate counter stats\n")
static int | config_write_stats_reporter (struct vty *vty, struct osmo_stats_reporter *srep)
static int | config_write_stats (struct vty *vty)
void | osmo_stats_vty_add_cmds (void)
| Add stats related commands to the VTY Call this once during your application initialization if you would like to have stats VTY commands enabled.

## Variables

struct host | host
struct cmd_node | cfg_stats_node
static const struct value_string | stats_class_strs []

## Detailed Description

VTY interface for statsd / statistic items.

This code allows you to register a couple of VTY commands that permit configuration of the Statistics reporting functionality from the VTY.

Use osmo_stats_vty_add_cmds once at application start-up to enable related commands.

## Macro Definition Documentation

## CFG_REPORTER_STR

#define CFG_REPORTER_STR "Configure a stats reporter\n"

Referenced by DEFUN(), DEFUN(), DEFUN(), and DEFUN().

## CFG_STATS_STR

#define CFG_STATS_STR "Configure stats sub-system\n"

Referenced by DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), DEFUN(), and DEFUN().

## SHOW_STATS_STR

#define SHOW_STATS_STR "Show statistical values\n"

Referenced by DEFUN(), and DEFUN().

## SKIP_ZERO_STR

#define SKIP_ZERO_STR "Skip items with total count zero\n"

Referenced by DEFUN(), DEFUN(), and DEFUN().

## STATS_STR

#define STATS_STR "Stats related commands\n"

Referenced by DEFUN(), and DEFUN().

## Function Documentation

## asciidoc_counter_generate()

void asciidoc_counter_generate | ( | struct vty * | vty | ) |

static

References asciidoc_handle_counter(), VTY_NEWLINE, and vty_out().

Referenced by DEFUN().

## asciidoc_handle_counter()

int asciidoc_handle_counter | ( | struct osmo_counter * | counter,
|  | void * | sctx_ )

static

References osmo_counter::description, osmo_counter::name, osmo_asciidoc_escape(), VTY_NEWLINE, and vty_out().

Referenced by asciidoc_counter_generate().

## asciidoc_osmo_stat_item_group_handler()

int asciidoc_osmo_stat_item_group_handler | ( | struct osmo_stat_item_group * | statg,
|  | void * | sctx_ )

static

References asciidoc_osmo_stat_item_handler(), osmo_stat_item_group::desc, osmo_stat_item_group_desc::group_description, osmo_stat_item_group_desc::group_name_prefix, osmo_asciidoc_escape(), VTY_NEWLINE, and vty_out().

Referenced by DEFUN().

## asciidoc_osmo_stat_item_handler()

int asciidoc_osmo_stat_item_handler | ( | struct osmo_stat_item_group * | statg,
|  | struct osmo_stat_item * | item,
|  | void * | sctx_ )

static

References osmo_stat_item_group::desc, osmo_stat_item_desc::description, osmo_stat_item_group_desc::group_name_prefix, osmo_asciidoc_escape(), osmo_stat_item_desc::unit, VTY_NEWLINE, and vty_out().

Referenced by asciidoc_osmo_stat_item_group_handler().

## asciidoc_rate_ctr_group_handler()

int asciidoc_rate_ctr_group_handler | ( | struct rate_ctr_group * | ctrg,
|  | void * | sctx_ )

static

References asciidoc_rate_ctr_handler(), rate_ctr_group::desc, rate_ctr_group_desc::group_description, rate_ctr_group_desc::group_name_prefix, osmo_asciidoc_escape(), VTY_NEWLINE, and vty_out().

Referenced by DEFUN().

## asciidoc_rate_ctr_handler()

int asciidoc_rate_ctr_handler | ( | struct rate_ctr_group * | ctrg,
|  | struct rate_ctr * | ctr,
|  | const struct rate_ctr_desc * | desc,
|  | void * | sctx_ )

static

References rate_ctr_group::desc, rate_ctr_group_desc::group_name_prefix, osmo_asciidoc_escape(), VTY_NEWLINE, and vty_out().

Referenced by asciidoc_rate_ctr_group_handler().

## config_write_stats()

int config_write_stats | ( | struct vty * | vty | ) |

static

References osmo_tcp_stats_config::batch_size, config_write_stats_reporter(), osmo_stats_config::interval, osmo_tcp_stats_config::interval, osmo_stats_reporter::list, VTY_NEWLINE, and vty_out().

Referenced by osmo_stats_vty_add_cmds().

## config_write_stats_reporter()

int config_write_stats_reporter | ( | struct vty * | vty,
|  | struct osmo_stats_reporter * | srep )

static

References osmo_stats_reporter::bind_addr_str, osmo_stats_reporter::dest_addr_str, osmo_stats_reporter::dest_port, osmo_stats_reporter::enabled, osmo_stats_reporter::flush_period, osmo_stats_reporter::have_net_config, osmo_stats_reporter::max_class, osmo_stats_reporter::mtu, osmo_stats_reporter::name, osmo_stats_reporter::name_prefix, stats_class_strs, osmo_stats_reporter::type, VTY_NEWLINE, and vty_out().

Referenced by config_write_stats().

## DEFUN() [1/25]

DEFUN | ( | cfg_no_stats_reporter_local_ip | ,
|  | cfg_no_stats_reporter_local_ip_cmd | ,
|  | "no local-ip" | ,
|  | NO_STR "Set the IP address to which we bind locally\n" | )

References NO_STR, and set_srep_parameter_str().

## DEFUN() [2/25]

DEFUN | ( | cfg_no_stats_reporter_log | ,
|  | cfg_no_stats_reporter_log_cmd | ,
|  | "no stats reporter log " | [NAME],
|  | NO_STR CFG_STATS_STR CFG_REPORTER_STR "Report to the logger\n" "Name of the reporter\n" | )

References argc, argv, CFG_REPORTER_STR, CFG_STATS_STR, CMD_SUCCESS, CMD_WARNING, NO_STR, VTY_NEWLINE, and vty_out().

## DEFUN() [3/25]

DEFUN | ( | cfg_no_stats_reporter_mtu | ,
|  | cfg_no_stats_reporter_mtu_cmd | ,
|  | "no mtu" | ,
|  | NO_STR "Set the maximum packet size\n" | )

References NO_STR, and set_srep_parameter_int().

## DEFUN() [4/25]

DEFUN | ( | cfg_no_stats_reporter_prefix | ,
|  | cfg_no_stats_reporter_prefix_cmd | ,
|  | "no prefix" | ,
|  | NO_STR "Set the item name prefix\n" | )

References NO_STR, and set_srep_parameter_str().

## DEFUN() [5/25]

DEFUN | ( | cfg_no_stats_reporter_statsd | ,
|  | cfg_no_stats_reporter_statsd_cmd | ,
|  | "no stats reporter statsd " | [NAME],
|  | NO_STR CFG_STATS_STR CFG_REPORTER_STR "Report to a STATSD server\n" "Name of the reporter\n" | )

References argc, argv, CFG_REPORTER_STR, CFG_STATS_STR, CMD_SUCCESS, CMD_WARNING, NO_STR, VTY_NEWLINE, and vty_out().

## DEFUN() [6/25]

DEFUN | ( | cfg_stats_interval | ,
|  | cfg_stats_interval_cmd | ,
|  | "stats interval <0-65535>" | ,
|  | CFG_STATS_STR "Set the reporting interval\n" "Interval in seconds (0 disables the reporting interval)\n" | )

References argv, CFG_STATS_STR, CMD_SUCCESS, CMD_WARNING, VTY_NEWLINE, and vty_out().

## DEFUN() [7/25]

DEFUN | ( | cfg_stats_reporter_disable | ,
|  | cfg_stats_reporter_disable_cmd | ,
|  | "disable" | ,
|  | "Disable the reporter\n" | )

References CMD_SUCCESS, CMD_WARNING, osmo_stats_vty2srep(), VTY_NEWLINE, and vty_out().

## DEFUN() [8/25]

DEFUN | ( | cfg_stats_reporter_enable | ,
|  | cfg_stats_reporter_enable_cmd | ,
|  | "enable" | ,
|  | "Enable the reporter\n" | )

References CMD_SUCCESS, CMD_WARNING, osmo_stats_vty2srep(), VTY_NEWLINE, and vty_out().

## DEFUN() [9/25]

DEFUN | ( | cfg_stats_reporter_flush_period | ,
|  | cfg_stats_reporter_flush_period_cmd | ,
|  | "flush-period <0-65535>" | ,
|  | CFG_STATS_STR "Send all stats even if they have not changed | i.e. force the flush)" "every N-th reporting interval. Set to 0 to disable regular flush (default).\n" "0 to disable regular flush (default,
|  | 1 to flush every | time,
|  | 2 to flush every 2nd | time,
|  | etc\n" | )

References argv, CFG_STATS_STR, CMD_SUCCESS, CMD_WARNING, osmo_stats_vty2srep(), VTY_NEWLINE, and vty_out().

## DEFUN() [10/25]

DEFUN | ( | cfg_stats_reporter_level | ,
|  | cfg_stats_reporter_level_cmd | ,
|  | "level (global|peer|subscriber)" | ,
|  | "Set the maximum group level\n" "Report global groups only\n" "Report global and network peer related groups\n" "Report | global,
|  | peer | ,
|  | and subscriber groups\n" | )

References argv, CMD_WARNING, osmo_stats_vty2srep(), stats_class_strs, VTY_NEWLINE, and vty_out().

## DEFUN() [11/25]

DEFUN | ( | cfg_stats_reporter_local_ip | ,
|  | cfg_stats_reporter_local_ip_cmd | ,
|  | "local-ip ADDR" | ,
|  | "Set the IP address to which we bind locally\n" "IP Address\n" | )

References argv, and set_srep_parameter_str().

## DEFUN() [12/25]

DEFUN | ( | cfg_stats_reporter_log | ,
|  | cfg_stats_reporter_log_cmd | ,
|  | "stats reporter log " | [NAME],
|  | CFG_STATS_STR CFG_REPORTER_STR "Report to the logger\n" "Name of the reporter\n" | )

References argc, argv, CFG_REPORTER_STR, CFG_STATS_NODE, CFG_STATS_STR, CMD_SUCCESS, CMD_WARNING, vty::index, osmo_stats_reporter::max_class, vty::node, VTY_NEWLINE, and vty_out().

## DEFUN() [13/25]

DEFUN | ( | cfg_stats_reporter_mtu | ,
|  | cfg_stats_reporter_mtu_cmd | ,
|  | "mtu <100-65535>" | ,
|  | "Set the maximum packet size\n" "Size in byte\n" | )

References argv, and set_srep_parameter_int().

## DEFUN() [14/25]

DEFUN | ( | cfg_stats_reporter_prefix | ,
|  | cfg_stats_reporter_prefix_cmd | ,
|  | "prefix PREFIX" | ,
|  | "Set the item name prefix\n" "The prefix string\n" | )

References argv, and set_srep_parameter_str().

## DEFUN() [15/25]

DEFUN | ( | cfg_stats_reporter_remote_ip | ,
|  | cfg_stats_reporter_remote_ip_cmd | ,
|  | "remote-ip ADDR" | ,
|  | "Set the remote IP address to which we connect\n" "IP Address\n" | )

References argv, and set_srep_parameter_str().

## DEFUN() [16/25]

DEFUN | ( | cfg_stats_reporter_remote_port | ,
|  | cfg_stats_reporter_remote_port_cmd | ,
|  | "remote-port <1-65535>" | ,
|  | "Set the remote port to which we connect\n" "Remote port number\n" | )

References argv, and set_srep_parameter_int().

## DEFUN() [17/25]

DEFUN | ( | cfg_stats_reporter_statsd | ,
|  | cfg_stats_reporter_statsd_cmd | ,
|  | "stats reporter statsd " | [NAME],
|  | CFG_STATS_STR CFG_REPORTER_STR "Report to a STATSD server\n" "Name of the reporter\n" | )

References argc, argv, CFG_REPORTER_STR, CFG_STATS_NODE, CFG_STATS_STR, CMD_SUCCESS, CMD_WARNING, vty::index, osmo_stats_reporter::max_class, vty::node, VTY_NEWLINE, and vty_out().

## DEFUN() [18/25]

DEFUN | ( | cfg_tcp_stats_batch_size | ,
|  | cfg_tcp_stats_batch_size_cmd | ,
|  | "stats-tcp batch-size <1-65535>" | ,
|  | CFG_STATS_STR "Set the number of tcp sockets that are processed per stats polling interval\n" "Number of sockets per interval\n" | )

References argv, osmo_tcp_stats_config::batch_size, CFG_STATS_STR, and CMD_SUCCESS.

## DEFUN() [19/25]

DEFUN | ( | cfg_tcp_stats_interval | ,
|  | cfg_tcp_stats_interval_cmd | ,
|  | "stats-tcp interval <0-65535>" | ,
|  | CFG_STATS_STR "Set the tcp socket stats polling interval\n" "Interval in seconds (0 disables the polling interval)\n" | )

References argv, CFG_STATS_STR, CMD_SUCCESS, CMD_WARNING, VTY_NEWLINE, and vty_out().

## DEFUN() [20/25]

DEFUN | ( | show_rate_counters | ,
|  | show_rate_counters_cmd | ,
|  | "show rate-counters " | [skip-zero],
|  | SHOW_STR "Show all rate counters\n" | SKIP_ZERO_STR )

References argc, CMD_SUCCESS, SHOW_STR, rctr_vty_ctx::skip_zero, and SKIP_ZERO_STR.

## DEFUN() [21/25]

DEFUN | ( | show_stats | ,
|  | show_stats_cmd | ,
|  | "show stats " | [skip-zero],
|  | SHOW_STR SHOW_STATS_STR | SKIP_ZERO_STR )

References argc, CMD_SUCCESS, SHOW_STATS_STR, SHOW_STR, SKIP_ZERO_STR, and vty_out_statistics_full2().

## DEFUN() [22/25]

DEFUN | ( | show_stats_asciidoc_table | ,
|  | show_stats_asciidoc_table_cmd | ,
|  | "show asciidoc counters" | ,
|  | SHOW_STR "Asciidoc generation\n" "Generate table of all registered counters\n" | )

References host::app_info, asciidoc_counter_generate(), asciidoc_osmo_stat_item_group_handler(), asciidoc_rate_ctr_group_handler(), CMD_SUCCESS, vty_app_info::name, SHOW_STR, vty_app_info::version, VTY_NEWLINE, and vty_out().

## DEFUN() [23/25]

DEFUN | ( | show_stats_level | ,
|  | show_stats_level_cmd | ,
|  | "show stats level (global|peer|subscriber) " | [skip-zero],
|  | SHOW_STR SHOW_STATS_STR "Set the maximum group level\n" "Show global groups only\n" "Show global and network peer related groups\n" "Show | global,
|  | peer | ,
|  | and subscriber groups\n" | SKIP_ZERO_STR )

References argc, argv, CMD_SUCCESS, SHOW_STATS_STR, SHOW_STR, SKIP_ZERO_STR, stats_class_strs, and vty_out_statistics_partial2().

## DEFUN() [24/25]

DEFUN | ( | stats_report | ,
|  | stats_report_cmd | ,
|  | "stats report" | ,
|  | STATS_STR "Manurally trigger reporting of stats\n" | )

References CMD_SUCCESS, and STATS_STR.

## DEFUN() [25/25]

DEFUN | ( | stats_reset | ,
|  | stats_reset_cmd | ,
|  | "stats reset" | ,
|  | STATS_STR "Reset all rate counter stats\n" | )

References CMD_SUCCESS, reset_rate_ctr_group_handler(), and STATS_STR.

## osmo_stats_vty2srep()

struct osmo_stats_reporter * osmo_stats_vty2srep | ( | struct vty * | vty | ) |

static

References CFG_STATS_NODE, vty::index, and vty::node.

Referenced by DEFUN(), DEFUN(), DEFUN(), DEFUN(), set_srep_parameter_int(), and set_srep_parameter_str().

## osmo_stats_vty_add_cmds()

void osmo_stats_vty_add_cmds | ( | void |  | ) |

Add stats related commands to the VTY Call this once during your application initialization if you would like to have stats VTY commands enabled.

References CFG_STATS_NODE, cfg_stats_node, CONFIG_NODE, config_write_stats(), ENABLE_NODE, install_lib_element(), install_lib_element_ve(), and install_node().

## rate_ctr_group_handler()

int rate_ctr_group_handler | ( | struct rate_ctr_group * | ctrg,
|  | void * | sctx_ )

static

References rate_ctr_group::desc, rate_ctr_group_desc::group_description, rate_ctr_group::idx, rate_ctr_group::name, rctr_vty_ctx::skip_zero, rctr_vty_ctx::vty, VTY_NEWLINE, vty_out(), and vty_out_rate_ctr_group_fmt2().

## reset_rate_ctr_group_handler()

int reset_rate_ctr_group_handler | ( | struct rate_ctr_group * | ctrg,
|  | void * | sctx_ )

static

Referenced by DEFUN().

## set_srep_parameter_int()

int set_srep_parameter_int | ( | struct vty * | vty,
|  | int(* | fun )(struct osmo_stats_reporter *, int),
|  | const char * | val,
|  | const char * | param_name )

static

References CMD_SUCCESS, CMD_WARNING, osmo_stats_vty2srep(), VTY_NEWLINE, and vty_out().

Referenced by DEFUN(), DEFUN(), and DEFUN().

## set_srep_parameter_str()

int set_srep_parameter_str | ( | struct vty * | vty,
|  | int(* | fun )(struct osmo_stats_reporter *, const char *),
|  | const char * | val,
|  | const char * | param_name )

static

References CMD_SUCCESS, CMD_WARNING, osmo_stats_vty2srep(), VTY_NEWLINE, and vty_out().

Referenced by DEFUN(), DEFUN(), DEFUN(), DEFUN(), and DEFUN().

## Variable Documentation

## cfg_stats_node

struct cmd_node cfg_stats_node

Initial value:
= {
CFG_STATS_NODE,
"%s(config-stats)# ",
1
}
CFG_STATS_NODE
@ CFG_STATS_NODE
Configure the statistics.
Definition command.h:82

Referenced by osmo_stats_vty_add_cmds().

## stats_class_strs

const struct value_string stats_class_strs[]

static

Initial value:
= {
{ OSMO_STATS_CLASS_GLOBAL, "global" },
{ OSMO_STATS_CLASS_PEER, "peer" },
{ OSMO_STATS_CLASS_SUBSCRIBER, "subscriber" },
{ 0, NULL }
}
OSMO_STATS_CLASS_PEER
OSMO_STATS_CLASS_PEER
OSMO_STATS_CLASS_GLOBAL
OSMO_STATS_CLASS_GLOBAL
OSMO_STATS_CLASS_SUBSCRIBER
OSMO_STATS_CLASS_SUBSCRIBER

Referenced by config_write_stats_reporter(), DEFUN(), and DEFUN().