Commit Graph

14 Commits

Author SHA1 Message Date
Harald Welte 2d2e2cca0d Update doxygen annotations in libosmocore
This adds and improves doxygen API descriptions all over libosmocore,
reducing the 'white spots' that don't have any documentation.
2016-05-05 18:49:27 +02:00
Jacob Erlbeck ee702cd590 stats: Add TODO comment to rate_ctr
Currently the counters are scanned twice, once for interval
computation and once for reporting.

This adds a reminder to move the interval computation code to a
special stats reporter which just shall update the fields.

Sponsored-by: On-Waves ehf
2015-11-26 12:53:12 +01:00
Jacob Erlbeck 423c1e5a4f core: Extend rate_ctr by helper functions
For global value reporting, some additional helper functions are
needed. The statsd protocol expects differential counter values,
which are currently not provided by rate_ctr (except for s/m/h/d
intervals).

This commit adds several helper functions to rate_ctr:

- rate_ctr_difference  returns the counter delta since the last
                       call to this function for a given counter
- rate_ctr_for_each_counter
                       iterates through each counter of a group
- rate_ctr_for_each_group
                       iterates through all globally registered
                       counter groups

Note that the rate_ctr_difference function can only be used by a
single backend, since it modifies the 'previous' field in the
rate_ctr obj.

Sponsored-by: On-Waves ehf
2015-10-28 23:51:24 +01:00
Sylvain Munaut dca7d2caaa doc: Fix the Doxygen section endings
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-04-18 21:53:23 +02:00
Harald Welte 9327c6dc0f doxygen: Add docs for rate_ctr 2011-08-17 17:14:12 +02:00
Pablo Neira Ayuso 0b21c1c885 timer: use namespace prefix osmo_timer*
Summary of changes:

s/struct timer_list/struct osmo_timer_list/g
s/bsc_add_timer/osmo_timer_add/g
s/bsc_schedule_timer/osmo_timer_schedule/g
s/bsc_del_timer/osmo_timer_del/g
s/bsc_timer_pending/osmo_timer_pending/g
s/bsc_nearest_timer/osmo_timers_nearest/g
s/bsc_prepare_timers/osmo_timers_prepare/g
s/bsc_update_timers/osmo_timers_update/g
s/bsc_timer_check/osmo_timers_check/g
2011-05-07 13:00:51 +02:00
Holger Hans Peter Freyther a9f526a1ab stats: Fix the compiler warnings
Do not remove the const, include strings.h for strcmp
2011-04-18 16:46:35 +02:00
Daniel Willmann 2d42ddeba3 Add functions to search for rate counters by name
* rate_ctr_get_group_by_name_idx, rate_ctr_get_by_name
2011-04-09 20:52:12 +02:00
Pablo Neira Ayuso 8341934844 include: reorganize headers file to include/osmocom/[gsm|core]
This patch moves all GSM-specific definitions to include/osmocom/gsm.
Moreover, the headers in include/osmocore/ have been moved to
include/osmocom/core.

This has been proposed by Harald Welte and Sylvain Munaunt.

Tested with `make distcheck'.

Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-23 18:09:28 +01:00
Holger Hans Peter Freyther 4f4b0101c4 rate_ctr: No need to include the inttypes.h
There should not be any u_int*_t types in this file, no need
to include this file. It is breaking compilation with the last
x86 build of GNU ARM for GCC 3.4.
2010-12-20 13:38:22 +01:00
Harald Welte d2dce6df04 [rate_ctr] always 'overflow' in next larger inetrval when interval ends
If a second ends, we add the number of events in that just-ended second
to the number of events in the currently running minute.  The same happens
at the end of a minute: We add the number of events in that just-ended
minute into the number of events of the still-running hour, etc.

This gives a much more meaningful numbers and we don't end up with
"12 events per second, but 0 events per minute" kind of situations
anymore.
2010-05-13 13:28:12 +02:00
Harald Welte dd178b2dc9 rate_counters: Remove group-name-sprintf-with-idx string 2010-05-13 12:50:44 +02:00
Harald Welte 087fcff9a5 rate_ctr: Store the numeric index as part of 'rate_ctr_group' 2010-05-13 12:16:17 +02:00
Harald Welte 7b45d60887 Add new 'rate counter' implementation to libosmocore
A 'rate counter' is a counter that counts events but also keeps
track of the rate of events (per second, minute, hour and day).

'rate counters' are generally abstracted in 'rate counter groups',
which are instances of a 'rate counter group description'.  This
way we can have e.g. a description describing what kind of counters
a BTS (or TRX) has - and we can then create one instance of that
group for every BTS or TRX that exists.
2010-05-13 11:35:30 +02:00