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 60 of file CallbackMetric.hpp.
|
inline |
Definition at line 80 of file CallbackMetric.hpp.
|
inlinevirtual |
Note this will only clone its behavior.
Definition at line 101 of file CallbackMetric.hpp.
|
inlinevirtual |
Definition at line 105 of file CallbackMetric.hpp.
|
virtual |
Definition at line 45 of file CallbackMetricImpl.hpp.
|
inlinevirtual |
Definition at line 117 of file CallbackMetric.hpp.
|
inlinevirtual |
Definition at line 121 of file CallbackMetric.hpp.
|
inline |
Definition at line 95 of file CallbackMetric.hpp.
|
inline |
Get the current value.
Definition at line 91 of file CallbackMetric.hpp.