summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJacob Erlbeck <jerlbeck@sysmocom.de>2015-11-09 15:33:44 +0100
committerJacob Erlbeck <jerlbeck@sysmocom.de>2015-11-26 12:52:24 +0100
commitb6e6bea4ecea4b0769fc56136321f01f553459ba (patch)
tree763a7e41398f8334f9f54edbc8c6145bb2c4a920 /include
parent5fa0dcc2750a79920d4a6404e960c50667840058 (diff)
stats: Move statsd related code into a separate file
This commit moves the stats specific code parts into stats_statsd.c while keeping the generic parts in stats.c. The code in stats.c no longer contains references to statsd symbols. Note that the VTY code still needs to know about every stats reporter backend. Sponsored-by: On-Waves ehf
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/core/stats.h16
1 files changed, 12 insertions, 4 deletions
diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h
index 39eae088..96f687e5 100644
--- a/include/osmocom/core/stats.h
+++ b/include/osmocom/core/stats.h
@@ -38,8 +38,8 @@ enum osmo_stats_class {
};
enum osmo_stats_reporter_type {
- OSMO_STATS_REPORTER_STATSD,
OSMO_STATS_REPORTER_LOG,
+ OSMO_STATS_REPORTER_STATSD,
};
struct osmo_stats_reporter {
@@ -96,9 +96,6 @@ struct osmo_stats_reporter *osmo_stats_reporter_alloc(enum osmo_stats_reporter_t
const char *name);
void osmo_stats_reporter_free(struct osmo_stats_reporter *srep);
-struct osmo_stats_reporter *osmo_stats_reporter_create_statsd(const char *name);
-struct osmo_stats_reporter *osmo_stats_reporter_create_log(const char *name);
-
struct osmo_stats_reporter *osmo_stats_reporter_find(enum osmo_stats_reporter_type type,
const char *name);
@@ -111,3 +108,14 @@ int osmo_stats_reporter_set_max_class(struct osmo_stats_reporter *srep,
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);
+
+/* reporter creation */
+struct osmo_stats_reporter *osmo_stats_reporter_create_log(const char *name);
+struct osmo_stats_reporter *osmo_stats_reporter_create_statsd(const char *name);
+
+/* helper functions for reporter implementations */
+int osmo_stats_reporter_send(struct osmo_stats_reporter *srep, const char *data,
+ int data_len);
+int osmo_stats_reporter_send_buffer(struct osmo_stats_reporter *srep);
+int osmo_stats_reporter_udp_open(struct osmo_stats_reporter *srep);
+int osmo_stats_reporter_udp_close(struct osmo_stats_reporter *srep);