andrzej-kaczmarek opened a new pull request #873: sys: Add framework for
logging aggregated data for events
This is proposed framework for logging aggregated data for events.
The idea is simple: there is an event which has multiple metrics we want to
log. Each metric is either a simple value (overwritten each time) or data
series (appended each time). When event is (re)started each data logged from
now on is aggregated internally. At the end of event its contents can be
serialized using CBOR and written to mbuf for further processing or writing to
logging subsystem (need to add append_mbuf API to logging for this). Now event
can be restarted and this starts again.
There is no limit for number of events other than memory capacity.
There is tentative limit for number of metrics for each event (32) due to
internal state variabled, but can be increased in future if necessary.
There is sample app which shows intended usage, however there is one thing
that needs more explanation. Once metrics are defined, each have name and value
For data series there are separate types for storing 8, 16 and 32-bit values
since it does make difference in terms of memory usage. For single values it
does not really matter so internally this is always stored as 32-bit value.
The metric name is, unfortunately, only used for serializing and accessing
it via e.g. shell (tbd) as it does not generate any symbol to actually pass it
to APIs. Thus, APIs identify each metric by ordinal number - as defined,
starting from 0. I'd really like to make this smarter, but without adding to
much extra macros or need for additional definitions in user code - have no
idea at the moment so any comments are welcome here. As a workaround, app can
define a simple enum with symbols corresponding to each metric and since its
auto-numbered from 0 it can be easily rearranged as required.
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
Apache Git Services