28 #include <sys/socket.h>
29 #include <arpa/inet.h>
41 enum osmo_stats_class {
42 OSMO_STATS_CLASS_UNKNOWN,
43 OSMO_STATS_CLASS_GLOBAL,
44 OSMO_STATS_CLASS_PEER,
45 OSMO_STATS_CLASS_SUBSCRIBER,
48 enum osmo_stats_reporter_type {
49 OSMO_STATS_REPORTER_LOG,
50 OSMO_STATS_REPORTER_STATSD,
53 struct osmo_stats_reporter {
54 enum osmo_stats_reporter_type type;
57 unsigned int have_net_config : 1;
66 enum osmo_stats_class max_class;
70 struct sockaddr dest_addr;
72 struct sockaddr bind_addr;
77 int force_single_flush;
80 int (*open)(
struct osmo_stats_reporter *srep);
81 int (*close)(
struct osmo_stats_reporter *srep);
82 int (*send_counter)(
struct osmo_stats_reporter *srep,
85 int64_t value, int64_t delta);
86 int (*send_item)(
struct osmo_stats_reporter *srep,
92 struct osmo_stats_config {
96 extern struct osmo_stats_config *osmo_stats_config;
98 void osmo_stats_init(
void *ctx);
99 int osmo_stats_report();
101 int osmo_stats_set_interval(
int interval);
103 struct osmo_stats_reporter *osmo_stats_reporter_alloc(
enum osmo_stats_reporter_type type,
105 void osmo_stats_reporter_free(
struct osmo_stats_reporter *srep);
107 struct osmo_stats_reporter *osmo_stats_reporter_find(
enum osmo_stats_reporter_type type,
110 int osmo_stats_reporter_set_remote_addr(
struct osmo_stats_reporter *srep,
const char *addr);
111 int osmo_stats_reporter_set_remote_port(
struct osmo_stats_reporter *srep,
int port);
112 int osmo_stats_reporter_set_local_addr(
struct osmo_stats_reporter *srep,
const char *addr);
113 int osmo_stats_reporter_set_mtu(
struct osmo_stats_reporter *srep,
int mtu);
114 int osmo_stats_reporter_set_max_class(
struct osmo_stats_reporter *srep,
115 enum osmo_stats_class class_id);
116 int osmo_stats_reporter_set_name_prefix(
struct osmo_stats_reporter *srep,
const char *prefix);
117 int osmo_stats_reporter_enable(
struct osmo_stats_reporter *srep);
118 int osmo_stats_reporter_disable(
struct osmo_stats_reporter *srep);
121 struct osmo_stats_reporter *osmo_stats_reporter_create_log(
const char *name);
122 struct osmo_stats_reporter *osmo_stats_reporter_create_statsd(
const char *name);
125 int osmo_stats_reporter_send(
struct osmo_stats_reporter *srep,
const char *data,
127 int osmo_stats_reporter_send_buffer(
struct osmo_stats_reporter *srep);
128 int osmo_stats_reporter_udp_open(
struct osmo_stats_reporter *srep);
129 int osmo_stats_reporter_udp_close(
struct osmo_stats_reporter *srep);
One instance of a counter group class.
Definition: rate_ctr.h:59
Osmocom message buffer.
Definition: msgb.h:37
Simple doubly linked list implementation.
(double) linked list header structure
Definition: linuxlist.h:47
One instance of a counter group class.
Definition: stat_item.h:58
statistics value description
Definition: stat_item.h:35
rate counter description
Definition: rate_ctr.h:39