summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-10-26 11:58:38 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-10-29 01:10:06 +0100
commitb1dbfb4c4179a62cd4b761ebdc7a3c2de5bdc0d9 (patch)
tree9adbbb2045cbb8a1e27755367f0dfc851f3f0e18 /include
parentadc900e0e38373193c8451c0310fe742d62c2c8e (diff)
stats: Implement timer based reporting
This calls stats_flush in regular intervals which polls the statistical values and calls the active reporters when values have changed. Sponsored-by: On-Waves ehf
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/core/stats.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h
index b4fb727c..489e0e41 100644
--- a/include/osmocom/core/stats.h
+++ b/include/osmocom/core/stats.h
@@ -32,7 +32,6 @@ struct stats_reporter {
/* config */
int enabled;
- int interval;
char *name_prefix;
char *dest_addr_str;
char *bind_addr_str;
@@ -50,9 +49,17 @@ struct stats_reporter {
struct llist_head list;
};
+struct stats_config {
+ int interval;
+};
+
+extern struct stats_config *stats_config;
+
void stats_init(void *ctx);
int stats_report();
+int stats_set_interval(int interval);
+
struct stats_reporter *stats_reporter_alloc(enum stats_reporter_type type,
const char *name);
void stats_reporter_free(struct stats_reporter *srep);
@@ -64,7 +71,6 @@ struct stats_reporter *stats_reporter_find(enum stats_reporter_type type,
int stats_reporter_set_remote_addr(struct stats_reporter *srep, const char *addr);
int stats_reporter_set_remote_port(struct stats_reporter *srep, int port);
int stats_reporter_set_local_addr(struct stats_reporter *srep, const char *addr);
-int stats_reporter_set_interval(struct stats_reporter *srep, int interval);
int stats_reporter_set_name_prefix(struct stats_reporter *srep, const char *prefix);
int stats_reporter_enable(struct stats_reporter *srep);
int stats_reporter_disable(struct stats_reporter *srep);