struct osmo_counter * osmo_counter_get_by_name(const char *name)
Find a counter by its name.
Definition: counter.c:86
int osmo_counters_for_each(int(*handle_counter)(struct osmo_counter *, void *), void *data)
Iterate over all counters; call handle_cunter call-back for each.
Definition: counter.c:61
static void osmo_counter_inc(struct osmo_counter *ctr)
Increment counter by one.
Definition: counter.h:28
struct osmo_counter * osmo_counter_alloc(const char *name) OSMO_DEPRECATED("Implement as osmo_stat_item instead")
Allocate a new counter with given name.
Definition: counter.c:36
int osmo_counter_difference(struct osmo_counter *ctr)
Compute difference between current and previous counter value.
Definition: counter.c:102
int osmo_counters_count(void)
Counts the registered counter.
Definition: counter.c:78
static void osmo_counter_reset(struct osmo_counter *ctr)
Reset current value of counter to 0.
Definition: counter.h:42
void osmo_counter_free(struct osmo_counter *ctr) OSMO_DEPRECATED("Implement as osmo_stat_item instead")
Release/Destroy a given counter.
Definition: counter.c:51
static unsigned long osmo_counter_get(struct osmo_counter *ctr)
Get current value of counter.
Definition: counter.h:35
static void osmo_counter_dec(struct osmo_counter *ctr)
Decrement given counter by one.
Definition: counter.h:20
General definitions that are meant to be included from header files.
#define inline
Definition: linuxlist.h:22
#define OSMO_DEPRECATED_OUTSIDE(text)
Definition: defs.h:49
#define OSMO_DEPRECATED(text)
Set the deprecated attribute with a message.
Definition: defs.h:41
static int handle_counter(struct osmo_counter *counter, void *vctx_)
(double) linked list header structure
Definition: linuxlist.h:46
Structure representing a single counter.
Definition: counter.h:9
struct llist_head list
internal list head
Definition: counter.h:10
const char * description
humn-readable description
Definition: counter.h:12
const char * name
human-readable name
Definition: counter.h:11
unsigned long value
current value
Definition: counter.h:13
unsigned long previous
previous value
Definition: counter.h:14