summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/stats.h
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-11-02 14:49:35 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-11-02 15:39:31 +0100
commitbc9d9aced8c174bbb5fc265ec746621d31344be0 (patch)
treeb5dc1666da0f145b9239e9a8be1e0dac1db4d8ec /include/osmocom/core/stats.h
parent16fe8dab7c1fede87f6bdbfbbcbf19f64d60648a (diff)
stats: Limit reporting by class id
This commit adds class_id fields to the rate_ctr and stat_item group descriptions. The stats reporter code is extended to only process groups whose class_id does not exceed a per reporter max_class level. If the class_id is not set, the code assumes 'global' for groups with idx == 0 and 'subscriber' otherwise. The following vty command is added to config-stats: level (global|peer|subscriber) Set the maximum group level Sponsored-by: On-Waves ehf
Diffstat (limited to 'include/osmocom/core/stats.h')
-rw-r--r--include/osmocom/core/stats.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h
index 7b3d0211..731fdb9b 100644
--- a/include/osmocom/core/stats.h
+++ b/include/osmocom/core/stats.h
@@ -28,6 +28,13 @@ struct osmo_stat_item_desc;
struct rate_ctr_group;
struct rate_ctr_desc;
+enum osmo_stats_class {
+ OSMO_STATS_CLASS_UNKNOWN,
+ OSMO_STATS_CLASS_GLOBAL,
+ OSMO_STATS_CLASS_PEER,
+ OSMO_STATS_CLASS_SUBSCRIBER,
+};
+
enum osmo_stats_reporter_type {
OSMO_STATS_REPORTER_STATSD,
OSMO_STATS_REPORTER_LOG,
@@ -46,6 +53,7 @@ struct osmo_stats_reporter {
char *bind_addr_str;
int dest_port;
int mtu;
+ enum osmo_stats_class max_class;
/* state */
int running;
@@ -95,6 +103,8 @@ int osmo_stats_reporter_set_remote_addr(struct osmo_stats_reporter *srep, const
int osmo_stats_reporter_set_remote_port(struct osmo_stats_reporter *srep, int port);
int osmo_stats_reporter_set_local_addr(struct osmo_stats_reporter *srep, const char *addr);
int osmo_stats_reporter_set_mtu(struct osmo_stats_reporter *srep, int mtu);
+int osmo_stats_reporter_set_max_class(struct osmo_stats_reporter *srep,
+ enum osmo_stats_class class_id);
int osmo_stats_reporter_set_name_prefix(struct osmo_stats_reporter *srep, const char *prefix);
int osmo_stats_reporter_enable(struct osmo_stats_reporter *srep);
int osmo_stats_reporter_disable(struct osmo_stats_reporter *srep);