void osmo_time_cc_set_flag(struct osmo_time_cc *tc, bool flag)
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
Report the cumulative counter of time for which a flag is true as rate counter.
Definition: time_cc.h:158
data we keep for each actual value
Definition: rate_ctr.h:29
uint64_t reported_sum
The amount of time that already reported cfg.rate_ctr increments account for.
Definition: time_cc.h:180
Osmocom timer handling routines.
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
int T_gran
Update gran_usec from this T timer value, or zero to not use any T timer.
Definition: time_cc.h:118
uint64_t total_sum
Overall cumulative sum.
Definition: time_cc.h:165
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
bool flag_state
Definition: time_cc.h:161
struct rate_ctr * rate_ctr
Rate counter to report to, or NULL to not use it.
Definition: time_cc.h:115
void osmo_time_cc_cleanup(struct osmo_time_cc *tc)
Configuration for osmo_time_cc.
Definition: time_cc.h:105
uint64_t sum
Internal cumulative counter of time that flag_state was true.
Definition: time_cc.h:177
uint64_t round_threshold_usec
Nr of microseconds above n * gran_usec at which to trigger a counter increment.
Definition: time_cc.h:111
uint64_t gran_usec
Granularity in microseconds: nr of microseconds that one rate_ctr increment represents.
Definition: time_cc.h:108
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
A structure representing a single instance of a timer.
Definition: timer.h:52
uint64_t forget_sum_usec
Forget counted sub-gran time after the flag was false for this long.
Definition: time_cc.h:113
Define a GSM timer of the form Tnnn, with unit, default value and doc string.
Definition: tdef.h:65
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
void osmo_time_cc_init(struct osmo_time_cc *tc)