libosmocore/include/osmocom
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 missing osmo_amr_type_name function. 2021-08-23 15:44:00 +02:00
coding gsm0503_parity: Fix compilation with gcc-10 2020-04-20 18:18:50 +02:00
core refactor stat_item: get rid of FIFO and "skipped" error 2021-09-30 18:33:43 +00:00
crypt kdf: add key derivation functions 2021-06-08 02:38:15 +02:00
ctrl ctrl: ports.h: Add OSMO_CTRL_PORT_BSC_NEIGH 2021-01-13 14:48:53 +01:00
gprs Revert "gb: Fix naming and export symbol bssgp_enc_rim_pdu" 2021-05-06 18:28:12 +00:00
gsm GPRS: Add PDP_TYPE_N_IETF_IPv4v6 2021-09-29 21:05:20 +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 vty: add vty_out_uptime() print the uptime to the vty 2021-09-23 13:12:34 +02:00