void osmo_time_cc_set_flag(struct osmo_time_cc *tc, bool flag)
void osmo_time_cc_cleanup(struct osmo_time_cc *tc)
void osmo_time_cc_init(struct osmo_time_cc *tc)
Define a GSM timer of the form Tnnn, with unit, default value and doc string.
Definition: tdef.h:65
Configuration for osmo_time_cc.
Definition: time_cc.h:105
int T_forget_sum
Update forget_sum_usec from this T timer value, or zero to not use any T timer.
Definition: time_cc.h:122
uint64_t gran_usec
Granularity in microseconds: nr of microseconds that one rate_ctr increment represents.
Definition: time_cc.h:108
struct rate_ctr * rate_ctr
Rate counter to report to, or NULL to not use it.
Definition: time_cc.h:115
uint64_t round_threshold_usec
Nr of microseconds above n * gran_usec at which to trigger a counter increment.
Definition: time_cc.h:111
int T_gran
Update gran_usec from this T timer value, or zero to not use any T timer.
Definition: time_cc.h:118
int T_round_threshold
Update round_threshold_usec from this T timer value, or zero to not use any T timer.
Definition: time_cc.h:120
struct osmo_tdef * T_defs
Look up T_gran and T_forget_sum in this list of timers, or NULL to not use any T timers.
Definition: time_cc.h:124
uint64_t forget_sum_usec
Forget counted sub-gran time after the flag was false for this long.
Definition: time_cc.h:113
Report the cumulative counter of time for which a flag is true as rate counter.
Definition: time_cc.h:158
uint64_t total_sum
Overall cumulative sum.
Definition: time_cc.h:165
uint64_t sum
Internal cumulative counter of time that flag_state was true.
Definition: time_cc.h:177
struct osmo_time_cc_cfg cfg
Definition: time_cc.h:159
uint64_t last_counted_time
CLOCK_MONOTONIC reading in microseconds, at the time when the osmo_time_cc last evaluated the flag st...
Definition: time_cc.h:173
bool flag_state
Definition: time_cc.h:161
struct osmo_timer_list timer
Definition: time_cc.h:167
uint64_t reported_sum
The amount of time that already reported cfg.rate_ctr increments account for.
Definition: time_cc.h:180
uint64_t start_time
CLOCK_MONOTONIC reading in microseconds, at the time when the osmo_time_cc instance started counting.
Definition: time_cc.h:170
A structure representing a single instance of a timer.
Definition: timer.h:52
data we keep for each actual value
Definition: rate_ctr.h:29
Osmocom timer handling routines.