libosmocore/src
Neels Hofmeyr e90c7176be refactor stat_item: get rid of FIFO and "skipped" error
Intead of attempting to store all distinct values of a reporting period,
just store min, max, last as well as a sum and N of each reporting
period.

This gets rid of error messages like

  DLSTATS ERROR stat_item.c:285 num_bts:oml_connected: 44 stats values skipped

while at the same time more accurately reporting the max value for each
reporting period. (So far stats_item only reports the max value; keep
that part unchanged, as shown in stats_test.c.)

With the other so far unused values (min, sum), we are ready to also
report the minimum value as well as an average value per reporting
period in the future, if/when our stats reporter allows for it.

Store the complete record of the previous reporting period. So far we
only compare the 'max' value, but like this we are ready to also see
changes in min, last and average value between reporting periods.

This patch breaks API by removing:
- struct members osmo_stats_item.stats_next_id, .last_offs and .values[]
- struct osmo_stats_item_value
- osmo_stat_item_get_next()
- osmo_stat_item_discard()
- osmo_stat_item_discard_all()
and by making struct osmo_stats_item opaque.
In libosmocore, we do have a policy of never breaking API. But since the
above should never be accessed by users of the osmo_stats_item API -- or
if they are, would no longer yield useful results, we decided to make an
exception in this case. The alternative would be to introduce a new
osmo_stats_item2 API and maintaining an unused legacy osmo_stats_item
forever, but we decided that the effort is not worth it. There are no
known users of the removed items.

Related: SYS#5542
Change-Id: I137992a5479fc39bbceb6c6c2af9c227bd33b39b
2021-09-30 18:33:43 +00:00
..
codec codec: Add functions for AMR s->d bits and d->s bits 2020-05-14 14:51:22 +02:00
coding gsm0503_coding: use ahs tables when encoding ahs codec id 2021-08-31 16:05:20 +02:00
ctrl CTRL: expose stat_item groups on CTRL 2021-09-14 10:28:05 +02:00
gb ns2: nsvc: add a uptime/downtime to track the last state change 2021-09-23 13:12:34 +02:00
gsm gsm: Mark gsm0858_rsl_ul_meas_enc() pointer param const 2021-09-28 11:32:00 +02:00
pseudotalloc pseudotalloc: Simplistic wrapper of talloc_named() 2019-07-31 10:16:07 +02:00
sim sim: Add osim_card_{reset,close}() API 2021-06-01 20:29:17 +02:00
usb usb: Add osmo_libusb_find_open_claim() all-in-one API 2020-05-12 05:43:21 +00:00
vty refactor stat_item: get rid of FIFO and "skipped" error 2021-09-30 18:33:43 +00:00
Makefile.am refactor stat_item: get rid of FIFO and "skipped" error 2021-09-30 18:33:43 +00:00
application.c application.c: drop wrong \references of osmo_init_ignore_signals() 2019-04-25 02:23:52 +07:00
backtrace.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
base64.c base64: reformat using Lindent to conform to our coding style 2021-09-21 19:57:56 +00:00
bitcomp.c bitcomp.c: fix missing Doxygen group closing tag 2019-04-25 02:23:52 +07:00
bits.c bits.c: Use faster look-up-table approach for osmo_revbytebits_{buf,u8} 2020-08-02 11:30:31 +02:00
bitvec.c bitvec: Fix left shifting out of range on signed variable 2020-11-13 12:09:02 +01:00
context.c context: Add support for [per-thread] global talloc contexts 2019-08-27 13:43:31 +02:00
conv.c conv: prevent theoretical NULL pointer dereference in osmo_conv_encode() 2020-02-09 04:27:47 +07:00
conv_acc.c libomsocoding: NEON viterbi acceleration 2020-08-06 16:47:40 +00:00
conv_acc_generic.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
conv_acc_neon.c libomsocoding: NEON viterbi acceleration 2020-08-06 16:47:40 +00:00
conv_acc_neon_impl.h libomsocoding: NEON viterbi acceleration 2020-08-06 16:47:40 +00:00
conv_acc_sse.c conv_acc: Our code requires SSSE3, not just SSE3 2017-11-17 11:44:22 +01:00
conv_acc_sse_avx.c conv_acc: Our code requires SSSE3, not just SSE3 2017-11-17 11:44:22 +01:00
conv_acc_sse_impl.h Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
counter.c counters: add osmo_counters_count() returns the amount of counters 2017-12-05 16:06:27 +01:00
crc16.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
crcXXgen.c.tpl Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
exec.c exec: osmo_system_nowait2: initalize *pw pointer with NULL 2020-05-12 11:03:51 +00:00
fsm.c fsm: cosmetic: fix weird spacing in osmo_fsm_inst_alloc() 2021-06-04 20:07:10 +00:00
gsmtap_util.c gsm_08_58.h: add Osmocom specific Bm/Lm CBITs for VAMOS 2021-05-26 21:18:11 +02:00
isdnhdlc.c isdnhdlc: Port from kernel to userspace 2018-05-11 21:57:46 +02:00
it_q.c Add inter-thread queue 2021-01-06 00:22:13 +01:00
logging.c gprs_ns2: rework logging of Rx and Tx NS PDU 2021-03-24 15:42:45 +00:00
logging_gsmtap.c logging: gsmtap: Store TID instead of PID in pkt hdr 2021-02-17 18:55:46 +01:00
logging_syslog.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
logging_systemd.c logging: introduce 'systemd-journal' target 2020-10-19 15:02:00 +00:00
loggingrb.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
macaddr.c macaddr: fix osmo_macaddr_parse(): return meaningful error codes 2020-08-27 01:10:51 +07:00
mnl.c mnl: Use mnl_socket_open() insatead of mnl_socket_open2() 2020-12-04 10:29:07 +01:00
msgb.c cosmetic: Fix typo in API doc 2020-09-27 12:58:23 +02:00
msgfile.c memleak: osmo_config_list_parse: getline() needs free also on error 2017-11-18 10:30:57 +00:00
panic.c osmo_panic(): Annotate as __attribute__ ((noreturn)) 2018-06-29 20:32:57 +02:00
plugin.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
prbs.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
prim.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
probes.d support for stats static userspace probes via systemtap 2021-02-22 09:58:00 +01:00
rate_ctr.c stat,rate_ctr: Allow setting group name and use it at report time 2021-06-05 15:46:27 +00:00
rbtree.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
select.c osmo_select_shutdown_request(): allow finishing pending writes on SIGTERM 2021-06-18 12:22:44 +00:00
sercomm.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
serial.c serial: Introduce API osmo_serial_speed_t 2020-11-13 22:58:14 +01:00
signal.c Revert "signal.c: Make non-exported tall_sigh_ctx static" 2019-03-22 13:25:01 +01:00
sockaddr_str.c sockaddr_str: add osmo_sockaddr_str_from_str2() which doesn't set the port 2020-09-02 15:22:57 +00:00
socket.c Make gcc 11.1.0 false positivies happy 2021-07-16 16:01:30 +00:00
stat_item.c refactor stat_item: get rid of FIFO and "skipped" error 2021-09-30 18:33:43 +00:00
stat_item_internal.h refactor stat_item: get rid of FIFO and "skipped" error 2021-09-30 18:33:43 +00:00
stats.c refactor stat_item: get rid of FIFO and "skipped" error 2021-09-30 18:33:43 +00:00
stats_statsd.c stat,rate_ctr: Allow setting group name and use it at report time 2021-06-05 15:46:27 +00:00
strrb.c Fix/Update copyright notices; Add SPDX annotation 2017-11-13 01:35:12 +09:00
tdef.c fix default_timeout type of osmo_tdef_fsm_inst_state_chg default_timeout 2021-04-28 18:31:31 +00:00
thread.c Introduce osmo_gettid() API 2021-02-17 18:24:17 +01:00
timer.c osmo_timer_pending: Make arg const 2021-04-29 20:14:51 +00:00
timer_clockgettime.c Fix embedded (arm-none-eabi) builds 2018-06-28 10:30:34 +02:00
timer_gettimeofday.c timer: Document osmo_gettimeofday API 2018-03-01 12:33:03 +00:00
use_count.c osmo_use_count_to_str: make robust against unused use_count 2020-09-30 18:48:12 +00:00
utils.c utils: add osmo_str_to_int() and osmo_str_to_int64() 2021-09-12 21:24:50 +02:00
write_queue.c write_queue: Re-enqueue msgb if write_cb returns -EAGAIN 2020-09-29 16:58:11 +00:00