aboutsummaryrefslogtreecommitdiffstats
path: root/tests/stats/stats_test.ok
AgeCommit message (Collapse)AuthorFilesLines
2021-03-17tests/stats: enable logging in test outputOliver Smith1-138/+0
Move test output from stdout to stderr and enable logging to stderr. This is in preparation for the next patch, which will add a new log message when osmo_stat_item_get_next() skips a value. Related: SYS#4877 Change-Id: Ie0eaec2f93ac6859397a6bfca45039fdcc27cb9e
2021-03-09stats: Ensure that each osmo_stat_item only reports once per intervalDaniel Willmann1-0/+6
We should never report multiple values for a metric. It is confusing for the log reporter and wrong for statsd. Statsd will record only one value, but will it be the first, last, ...? This can happen if an osmo_stat_item changes more than once within the same reporting interval. With this patch only one aggregate value is sent to the log reporters. The value reported is the maximum during this interval. Other aggregations could be possible (min, last), but reporting a (useful) average is not because the values don't include a timestamp and most osmo_stat_items change at unregular intervals. Change-Id: I366ab1c66f4ae6363111ea4e41b66b7d5bcade9c Related: SYS#4877
2017-10-24stats_test: Extend check to include test for counter group name manglingHarald Welte1-0/+24
In Change-Id Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56 we introduce name mangling to replace any '.' in counter (group) names to be converted to ':'. Let's test for this functionality explicitly as part of the stats_test. Change-Id: Ie35682aa79526e2ffeab6995cd640b7847d855bf
2017-10-24rate_ctr: Enforce counter (and ctr_group) names are valid identifiersHarald Welte1-42/+42
As rate counters are automatically exposed on the CTRL interface, we need to make sure they don't contain special characters such as '.' which are not permitted/supported by CTRL. In order to be able to run old versions of osmocom programs with libosmocore versions after this commit, we introduce some special name mangling: Any '.' in the names are replaced with ':' during counter group registration, if valid identifiers can be obtained this way. Change-Id: Ifc6ac824f5dae9a848bb4a5d067c64a69eb40b56
2015-11-26stats/test: Add test for reportingJacob Erlbeck1-0/+108
This tests uses a dedicated test reported to check several aspects of the value reporting. - addition/removal of stats reporter - addition/removal of counters/items - setting of max_class - initial value flush - updating single counters/items - reporter retrieval - enable/disable Sponsored-by: On-Waves ehf
2015-10-28stats: Add stat_item for value monitoringJacob Erlbeck1-0/+0
This commit adds instrumentation function to gather measurement and statistical values similar to counter groups. Multiple values can be stored per item, which can be retrieved in FIFO order. Getting values from the item does not modify its state to allow for multiple independant backends (e.g. VTY and statd). When a new value is set, the oldest value gets silently overwritten. Lost values are skipped when getting values from the item. Sponsored-by: On-Waves ehf