Metric that uses a callback to determine the value at sample time. More...
#include <CallbackMetric.hpp>
Public Member Functions | |
CallbackMetric (const char *name, CallbackFn f, bool reg_new=true) | |
T | value () const |
Get the current value. More... | |
void | start_merging () |
virtual CallbackMetric< T > * | clone () const |
Note this will only clone its behavior. More... | |
virtual std::ostream & | json (std::ostream &o) const |
virtual void | reset () |
virtual void | sample () |
virtual void | merge_all (impl::MetricBase *static_stat_ptr) |
Metric that uses a callback to determine the value at sample time.
Used for sampling state when the state is not declared within modifiable code. An example would be keeping track of the length of a std::vector. One would create a CallbackMetric with the callback vector.size();
Definition at line 49 of file CallbackMetric.hpp.
|
inline |
Definition at line 69 of file CallbackMetric.hpp.
|
inlinevirtual |
Note this will only clone its behavior.
Definition at line 90 of file CallbackMetric.hpp.
|
inlinevirtual |
Definition at line 94 of file CallbackMetric.hpp.
|
virtual |
Definition at line 34 of file CallbackMetricImpl.hpp.
|
inlinevirtual |
Definition at line 106 of file CallbackMetric.hpp.
|
inlinevirtual |
Definition at line 110 of file CallbackMetric.hpp.
|
inline |
Definition at line 84 of file CallbackMetric.hpp.
|
inline |
Get the current value.
Definition at line 80 of file CallbackMetric.hpp.