mirror of https://gerrit.osmocom.org/libosmocore
counters: add osmo_counters_count() returns the amount of counters
Change-Id: I9068231d71876e06d27ee67a688d7fb611ac3a1b
This commit is contained in:
parent
ad1797e359
commit
18ba26cfab
|
@ -44,6 +44,8 @@ void osmo_counter_free(struct osmo_counter *ctr);
|
|||
|
||||
int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *), void *data);
|
||||
|
||||
int osmo_counters_count();
|
||||
|
||||
struct osmo_counter *osmo_counter_get_by_name(const char *name);
|
||||
|
||||
int osmo_counter_difference(struct osmo_counter *ctr);
|
||||
|
|
|
@ -77,6 +77,13 @@ int osmo_counters_for_each(int (*handle_counter)(struct osmo_counter *, void *),
|
|||
return rc;
|
||||
}
|
||||
|
||||
/*! Counts the registered counter
|
||||
* \returns amount of counters */
|
||||
int osmo_counters_count()
|
||||
{
|
||||
return llist_count(&counters);
|
||||
}
|
||||
|
||||
/*! Find a counter by its name.
|
||||
* \param[in] name Name used to look-up/search counter
|
||||
* \returns Counter on success; NULL if not found */
|
||||
|
|
Loading…
Reference in New Issue