30 #include <sys/socket.h>
31 #include <arpa/inet.h>
43 enum osmo_stats_class {
44 OSMO_STATS_CLASS_UNKNOWN,
45 OSMO_STATS_CLASS_GLOBAL,
46 OSMO_STATS_CLASS_PEER,
47 OSMO_STATS_CLASS_SUBSCRIBER,
50 enum osmo_stats_reporter_type {
51 OSMO_STATS_REPORTER_LOG,
52 OSMO_STATS_REPORTER_STATSD,
55 struct osmo_stats_reporter {
56 enum osmo_stats_reporter_type
type;
59 unsigned int have_net_config : 1;
68 enum osmo_stats_class max_class;
72 struct sockaddr dest_addr;
74 struct sockaddr bind_addr;
79 int force_single_flush;
82 int (*open)(
struct osmo_stats_reporter *srep);
83 int (*close)(
struct osmo_stats_reporter *srep);
84 int (*send_counter)(
struct osmo_stats_reporter *srep,
87 int64_t value, int64_t delta);
88 int (*send_item)(
struct osmo_stats_reporter *srep,
112 int osmo_stats_reporter_set_remote_addr(
struct osmo_stats_reporter *srep,
const char *addr);
113 int osmo_stats_reporter_set_remote_port(
struct osmo_stats_reporter *srep,
int port);
114 int osmo_stats_reporter_set_local_addr(
struct osmo_stats_reporter *srep,
const char *addr);
115 int osmo_stats_reporter_set_mtu(
struct osmo_stats_reporter *srep,
int mtu);
117 enum osmo_stats_class class_id);
127 int osmo_stats_reporter_send(
struct osmo_stats_reporter *srep,
const char *data,
129 int osmo_stats_reporter_send_buffer(
struct osmo_stats_reporter *srep);
130 int osmo_stats_reporter_udp_open(
struct osmo_stats_reporter *srep);
131 int osmo_stats_reporter_udp_close(
struct osmo_stats_reporter *srep);
struct osmo_stats_reporter * osmo_stats_reporter_create_statsd(const char *name)
Definition: stats_statsd.c:49
int osmo_stats_reporter_enable(struct osmo_stats_reporter *srep)
Definition: stats.c:286
struct osmo_stats_reporter * osmo_stats_reporter_find(enum osmo_stats_reporter_type type, const char *name)
Definition: stats.c:156
int osmo_stats_set_interval(int interval)
Definition: stats.c:265
int osmo_stats_reporter_set_name_prefix(struct osmo_stats_reporter *srep, const char *prefix)
Definition: stats.c:277
One instance of a counter group class.
Definition: rate_ctr.h:57
Osmocom message buffer.
Definition: msgb.h:35
struct osmo_stats_config * osmo_stats_config
Definition: stats.c:63
char name[32]
source file name
Definition: gsmtap.h:122
int osmo_stats_reporter_disable(struct osmo_stats_reporter *srep)
Definition: stats.c:293
int osmo_stats_report()
Definition: stats.c:614
Simple doubly linked list implementation.
(double) linked list header structure
Definition: linuxlist.h:46
int osmo_stats_reporter_set_max_class(struct osmo_stats_reporter *srep, enum osmo_stats_class class_id)
Definition: stats.c:254
void osmo_stats_init(void *ctx)
Definition: stats.c:147
One instance of a counter group class.
Definition: stat_item.h:56
uint8_t type
see GSMTAP_TYPE_*
Definition: gsmtap.h:113
void osmo_stats_reporter_free(struct osmo_stats_reporter *srep)
Definition: stats.c:140
statistics value description
Definition: stat_item.h:33
rate counter description
Definition: rate_ctr.h:37
struct osmo_stats_reporter * osmo_stats_reporter_alloc(enum osmo_stats_reporter_type type, const char *name)
Definition: stats.c:124
struct osmo_stats_reporter * osmo_stats_reporter_create_log(const char *name)
Definition: stats.c:400