libosmocore  1.0.1.85-9f28
Osmocom core library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
stats_statsd.c File Reference
#include "config.h"
#include <osmocom/core/stats.h>
#include <string.h>
#include <stdint.h>
#include <errno.h>
#include <osmocom/core/utils.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/stat_item.h>
#include <osmocom/core/msgb.h>

Functions

static int osmo_stats_reporter_statsd_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)
 
static int osmo_stats_reporter_statsd_send_item (struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, int64_t value)
 
struct osmo_stats_reporterosmo_stats_reporter_create_statsd (const char *name)
 Create a stats_reporter reporting to statsd. More...
 
static void osmo_stats_reporter_sanitize_name (char *buf)
 Replace all illegal ':' in the stats name, but not when used as value seperator. More...
 
static int osmo_stats_reporter_statsd_send (struct osmo_stats_reporter *srep, const char *name1, unsigned int index1, const char *name2, int64_t value, const char *unit)
 

Function Documentation

static void osmo_stats_reporter_sanitize_name ( char *  buf)
static

Replace all illegal ':' in the stats name, but not when used as value seperator.

':' is used as seperator between the name and the value in the statsd protocol.

Parameters
[in,out]bufis a null terminated string containing name, value, unit.

Referenced by osmo_stats_reporter_statsd_send().

static int osmo_stats_reporter_statsd_send ( struct osmo_stats_reporter srep,
const char *  name1,
unsigned int  index1,
const char *  name2,
int64_t  value,
const char *  unit 
)
static
static int osmo_stats_reporter_statsd_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 
)
static
static int osmo_stats_reporter_statsd_send_item ( struct osmo_stats_reporter srep,
const struct osmo_stat_item_group statg,
const struct osmo_stat_item_desc desc,
int64_t  value 
)
static