27#if defined(unix) || defined(__APPLE__)
29#include <sys/socket.h>
96 int64_t value, int64_t delta);
enum osmo_sub_auth_type type
struct osmo_stats_reporter * osmo_stats_reporter_alloc(enum osmo_stats_reporter_type type, const char *name)
Definition: stats.c:212
int osmo_stats_reporter_udp_open(struct osmo_stats_reporter *srep)
void osmo_stats_reporter_free(struct osmo_stats_reporter *srep)
Destroy a given stats_reporter.
Definition: stats.c:232
int osmo_stats_reporter_set_name_prefix(struct osmo_stats_reporter *srep, const char *prefix)
Set the name prefix of a given stats_reporter.
Definition: stats.c:419
int osmo_stats_reporter_set_flush_period(struct osmo_stats_reporter *srep, unsigned int period)
Set the regular flush period for a given stats_reporter.
Definition: stats.c:404
int osmo_stats_reporter_set_remote_port(struct osmo_stats_reporter *srep, int port)
int osmo_stats_reporter_disable(struct osmo_stats_reporter *srep)
Disable the given stats_reporter.
Definition: stats.c:442
int osmo_stats_reporter_set_max_class(struct osmo_stats_reporter *srep, enum osmo_stats_class class_id)
Definition: stats.c:370
int osmo_stats_reporter_set_mtu(struct osmo_stats_reporter *srep, int mtu)
struct osmo_stats_config * osmo_stats_config
Definition: stats.c:113
int osmo_stats_set_interval(int interval)
Set the reporting interval (common for all reporters)
Definition: stats.c:384
int osmo_stats_reporter_udp_close(struct osmo_stats_reporter *srep)
struct osmo_stats_reporter * osmo_stats_reporter_find(enum osmo_stats_reporter_type type, const char *name)
Find a stats_reporter of given type and name.
Definition: stats.c:256
int osmo_stats_report(void)
Definition: stats.c:790
struct osmo_stats_reporter * osmo_stats_reporter_create_statsd(const char *name)
Create a stats_reporter reporting to statsd.
Definition: stats_statsd.c:53
int osmo_stats_reporter_set_remote_addr(struct osmo_stats_reporter *srep, const char *addr)
osmo_stats_reporter_type
Statistics Reporter Type.
Definition: stats.h:51
struct osmo_stats_reporter * osmo_stats_reporter_create_log(const char *name)
Create a stats_reporter that logs via libosmocore logging.
Definition: stats.c:572
void osmo_stats_init(void *ctx)
Initialize the stats reporting module; call this once in your program.
Definition: stats.c:241
int osmo_stats_reporter_set_local_addr(struct osmo_stats_reporter *srep, const char *addr)
int osmo_stats_reporter_enable(struct osmo_stats_reporter *srep)
Enable the given stats_reporter.
Definition: stats.c:432
int osmo_stats_reporter_send_buffer(struct osmo_stats_reporter *srep)
int osmo_stats_reporter_send(struct osmo_stats_reporter *srep, const char *data, int data_len)
struct llist_head osmo_stats_reporter_list
osmo_stats_class
Statistics Class definitions.
Definition: stats.h:43
@ OSMO_STATS_REPORTER_LOG
libosmocore logging
Definition: stats.h:52
@ OSMO_STATS_REPORTER_STATSD
statsd backend
Definition: stats.h:53
@ OSMO_STATS_CLASS_UNKNOWN
unknown class
Definition: stats.h:44
@ OSMO_STATS_CLASS_PEER
peer in a communications link
Definition: stats.h:46
@ OSMO_STATS_CLASS_GLOBAL
global counter/stat_item
Definition: stats.h:45
@ OSMO_STATS_CLASS_SUBSCRIBER
subscriber
Definition: stats.h:47
Simple doubly linked list implementation.
(double) linked list header structure
Definition: linuxlist.h:46
Osmocom message buffer.
Definition: msgb.h:31
Statistics item description.
Definition: stat_item.h:22
One instance of a counter group class.
Definition: stat_item.h:45
int interval
Definition: stats.h:104
One statistics reporter instance.
Definition: stats.h:57
unsigned int flush_period_counter
count sends between forced flushes
Definition: stats.h:88
int dest_port
destination (UDP) port
Definition: stats.h:70
int dest_addr_len
length of dest_addr in bytes
Definition: stats.h:81
struct sockaddr bind_addr
local bind address of socket
Definition: stats.h:82
int force_single_flush
set to 1 to force a flush (send even unchanged stats values)
Definition: stats.h:87
int(* send_counter)(struct osmo_stats_reporter *srep, const struct rate_ctr_group *ctrg, const struct rate_ctr_desc *desc, int64_t value, int64_t delta)
Definition: stats.h:93
unsigned int have_net_config
Definition: stats.h:63
int fd
file descriptor of socket
Definition: stats.h:84
int enabled
is this reporter enabled
Definition: stats.h:66
int(* close)(struct osmo_stats_reporter *srep)
Definition: stats.h:92
int mtu
Maximum Transmission Unit.
Definition: stats.h:71
int bind_addr_len
length of bind_addr in bytes
Definition: stats.h:83
enum osmo_stats_reporter_type type
Type of the reporter (log, statsd)
Definition: stats.h:59
int(* send_item)(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int64_t value)
Definition: stats.h:97
enum osmo_stats_class max_class
Maximum class/index to report.
Definition: stats.h:75
int agg_enabled
is aggregation enabled?
Definition: stats.h:86
struct msgb * buffer
message buffer for log output
Definition: stats.h:85
int(* open)(struct osmo_stats_reporter *srep)
Definition: stats.h:91
int running
is this reporter running
Definition: stats.h:79
char * name_prefix
prefix for counter names
Definition: stats.h:67
char * dest_addr_str
destination IP address
Definition: stats.h:68
struct llist_head list
Definition: stats.h:90
char * name
Human-readable name of this reporter.
Definition: stats.h:61
unsigned int flush_period
period between regular flushes
Definition: stats.h:72
struct sockaddr dest_addr
destination address of socket
Definition: stats.h:80
char * bind_addr_str
local bind IP address
Definition: stats.h:69
rate counter description
Definition: rate_ctr.h:37
One instance of a counter group class.
Definition: rate_ctr.h:57