summaryrefslogtreecommitdiffstats
path: root/include/osmocom/core/stats.h
Commit message (Collapse)AuthorAgeFilesLines
* stats.h: Fix build on MacOSPau Espin Pedrol2018-12-131-2/+2
| | | | | | | Otherwise struct osmo_stats_config is not defined and compiler fails. Related: OS#3722 Change-Id: I037c3ca141ecee2d457e0a881a56e32ee24cec4d
* Fix/Update copyright notices; Add SPDX annotationHarald Welte2017-11-131-1/+1
| | | | | | | | Let's fix some erroneous/accidential references to wrong license, update copyright information where applicable and introduce a SPDX-License-Identifier to all files. Change-Id: I39af26c6aaaf5c926966391f6565fc5936be21af
* [doc] Add Doxygen API documentation for stats.c and stats_statsd.cHarald Welte2017-10-161-21/+33
| | | | Change-Id: I8e49505f5c19beac90290fdba8821714e8eecd97
* doxygen: unify use of \file across the boardNeels Hofmeyr2017-06-231-1/+3
| | | | | | | | | | | | | | | | | Considering the various styles and implications found in the sources, edit scores of files to follow the same API doc guidelines around the doxygen grouping and the \file tag. Many files now show a short description in the generated API doc that was so far only available as C comment. The guidelines and reasoning behind it is documented at https://osmocom.org/projects/cellular-infrastructure/wiki/Guidelines_for_API_documentation In some instances, remove file comments and add to the corresponding group instead, to be shared among several files (e.g. bitvec). Change-Id: Ifa70e77e90462b5eb2b0457c70fd25275910c72b
* stats: Disable stats*.c on embedded targetsHarald Welte2017-05-151-0/+10
| | | | Change-Id: I6beb4fcc394ed7d3f8dd7a097b6e998245ecf401
* statsd: Fix compiler warning (int32_t vs. int64_t)Harald Welte2016-11-111-1/+1
| | | | | | | | | Fixes the following compiler warning: stats_statsd.c: In function ‘osmo_stats_reporter_create_statsd’: stats_statsd.c:54:18: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] srep->send_item = osmo_stats_reporter_statsd_send_item; Change-Id: Id36914906e0982f6ac092a311210727de66b343a
* stats: Move statsd related code into a separate fileJacob Erlbeck2015-11-261-4/+12
| | | | | | | | | | | This commit moves the stats specific code parts into stats_statsd.c while keeping the generic parts in stats.c. The code in stats.c no longer contains references to statsd symbols. Note that the VTY code still needs to know about every stats reporter backend. Sponsored-by: On-Waves ehf
* stats: Send all values on reporter updateJacob Erlbeck2015-11-091-0/+1
| | | | | | | | | | | | | | | | | | | | | Currently only counter changes and new item values are being reported. This makes it cumbersome to configure reporting clients, since there is nothing like a list of all parameters. This commit changes this behaviour such that all currently existing counters and items that would be reported eventually, are passed to the reporter when it has been reconfigured or enabled. If a counter has not been incremented, 0 is sent. If a stat item value has not been added, the last item value (or the default value if there is none) is resent again. Note that this will not catch transient counters/items that will be created later on, e.g. triggered by new peers or subscribers. To just force this kind of dump on a running reporter, it is sufficient to invoke the 'enable' command in its configuration node. Sponsored-by: On-Waves ehf
* stats: Fix build on FreeBSDHolger Hans Peter Freyther2015-08-211-0/+2
| | | | | include stdint.h for int64_t and use netinet/in.h and not netinet/ip.h for getting sockaddr_in and such.
* stats: Limit reporting by class idJacob Erlbeck2015-11-021-0/+10
| | | | | | | | | | | | | | | This commit adds class_id fields to the rate_ctr and stat_item group descriptions. The stats reporter code is extended to only process groups whose class_id does not exceed a per reporter max_class level. If the class_id is not set, the code assumes 'global' for groups with idx == 0 and 'subscriber' otherwise. The following vty command is added to config-stats: level (global|peer|subscriber) Set the maximum group level Sponsored-by: On-Waves ehf
* stats: Add osmo_ name prefix to identifiersJacob Erlbeck2015-11-021-30/+30
| | | | | | | | | | Since the the stat_item and stats functions and data types are meant to be exported, they get an osmo_ prefix. Sponsored-by: On-Waves ehf [hfreyther: Prepended the enum values too. This was requested by Jacob]
* stats: Add log reporterJacob Erlbeck2015-10-291-0/+3
| | | | | | | This reporter passes the measurement values to the logging subsystem as DSTATS (which is currently DLGLOBAL) level INFO messages. Sponsored-by: On-Waves ehf
* stats: Use function pointers in reporter objectsJacob Erlbeck2015-10-291-0/+14
| | | | | | | | | | | | Currently case statements are used to select the right reporter functions. This makes it difficult to add new reporter types, especially if they are not going to reside in the same file. This commit introduces per reporter function pointer for open, close, send_count, and send_item. They are checked for non-NULL before being called or skipped. Sponsored-by: On-Waves ehf
* stats: Make net config optionalJacob Erlbeck2015-10-291-0/+2
| | | | | | | | To support reporters without network configuration, this commit introduces the have_net_config flag to provide corresponding error messages. Sponsored-by: On-Waves ehf
* stats: Support statsd Multi-Metric PacketsJacob Erlbeck2015-10-291-0/+5
| | | | | | | | | | | | | | | | If the MTU is given, combine several messages into a single UDP packet until the limit is reached. Flush all reporters after the values have been scanned. New vty commands (node config-stats): mtu <100-65535> Enable multi-metric packets and set the maximum packet size (in byte) no mtu Disable multi-metric packets Note that single messages that are longer than the given MTU (minus 28 octets protocol overhead) will be dropped. Sponsored-by: On-Waves ehf
* stats: Implement timer based reportingJacob Erlbeck2015-10-291-2/+8
| | | | | | | | This calls stats_flush in regular intervals which polls the statistical values and calls the active reporters when values have changed. Sponsored-by: On-Waves ehf
* stats: Add the reporting frameworkJacob Erlbeck2015-10-291-0/+70
This commit provides the stats reporting framework that can manage several types of measurement reporters. Initially support for rate_ctr and the statsd protocol is included. Sponsored-by: On-Waves ehf