[examples]: example of a histogram counter
Hello! I'm looking for good examples of how others have used the TRACE_COUNTER macro in order to implement a basic histogram / metrics API for application observability. Ideally, something lightweight (i.e. not UMA) would be great to have in the //examples directory.
Thanks in advance!
cc @skyostil @betasheet @ddiproietto for the SDK
@chromy From diving in a little deeper, it looks like there are already some Histogram types exposed in different protos upstream (e.g., ProfilePacket). However, it's not clear to me how to utilize them within the SDK. Maybe something like the example below would be useful to have upstream.
perfetto::HistogramTrack my_hist (/*num_buckets=*/kMaxBuckets);
TRACE_HIST("mycategory", my_hist, <sample>);
TRACE_HIST("mycategory", my_hist, <sample>, <bin>);
Where the underlying Histogram bin calculator function is configurable somehow. Looking forward to some example links!
CC @skyostil @betasheet @ddiproietto
I believe the only current supported use of TRACE_COUNTER is a simple numeric value counter (see example in docs). There's no support for histogram counters (yet).