[go: up one dir, main page]

Skip to content

Tiny header-only C++ metrics library for embedded projects

License

Notifications You must be signed in to change notification settings

renaatd/cpp-metrics

Repository files navigation

C++ Metrics

Build status

C++ Metrics is a header-only library to measure parameter distributions in an embedded application. The library is inspired by Coda Hale's Metrics library, but has fewer features.

Metrics

Class Description
Gauge Store a single measurement
MinMax Store minimum/maximum measurement
MinMeanMax Same as above + mean value
Variance Same as above + (sample) variance, (sample) standard deviation, and RMS
Kurtosis Same as above + skew and kurtosis
LinearRegression Least squares linear regression - best fit line through measurements
Histogram Store n samples in a reservoir, get bins, min/Q25/Q50/Q75/max

Reservoirs for histogram

Class Description
SlidingWindowReservoir Store last n measurements
SamplingReservoir Store n randomly selected measurements from all measurements

Features

  • low overhead: typically < 10 ns / measurement
  • updating is made thread-safe by using mutexes, mutexes can be disabled at compile time
  • optional registry for reporting all metrics at once
  • no build system needed, just copy the header files in a project
  • no background threads
  • no external dependencies

Limitations

  • uses naive locking (mutex) when sampling - can impact performance on some processors or when parallellism is very high
  • no rate-type measurements

Algorithms

See also

About

Tiny header-only C++ metrics library for embedded projects

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published