Metric that simply keeps track of a single string value over time. More...
#include <StringMetric.hpp>
Public Types | |
enum | { max_string_size = 2048 } |
Public Member Functions | |
StringMetric (const char *name, std::string initial_value, bool reg_new=true) | |
virtual std::ostream & | json (std::ostream &o) const |
virtual void | reset () |
virtual void | sample () |
virtual StringMetric * | clone () const |
virtual void | merge_all (impl::MetricBase *static_stat_ptr) |
std::string | value () const |
Get the current value. More... | |
const StringMetric & | operator+= (std::string appended) |
operator std::string () const | |
StringMetric & | operator= (std::string value) |
Static Public Member Functions | |
static void | write_chars (char *dst, std::string newstr, std::string name="(anonymous)") |
Protected Types | |
typedef std::function < std::string(void)> | InitFn |
Protected Attributes | |
std::string | initial_value |
char | value_ [max_string_size] |
InitFn | initf_ |
Metric that simply keeps track of a single string value over time.
Typically used as a counter, but can also be used for sampling an instantaneous value.
Definition at line 52 of file StringMetric.hpp.
|
protected |
Definition at line 69 of file StringMetric.hpp.
anonymous enum |
Enumerator | |
---|---|
max_string_size |
Definition at line 54 of file StringMetric.hpp.
|
inline |
Definition at line 82 of file StringMetric.hpp.
|
inlinevirtual |
Definition at line 115 of file StringMetric.hpp.
|
inlinevirtual |
Definition at line 95 of file StringMetric.hpp.
|
virtual |
Definition at line 10 of file StringMetricImpl.hpp.
|
inline |
Definition at line 140 of file StringMetric.hpp.
|
inline |
Definition at line 133 of file StringMetric.hpp.
|
inline |
Definition at line 142 of file StringMetric.hpp.
|
inlinevirtual |
Definition at line 100 of file StringMetric.hpp.
|
inlinevirtual |
Definition at line 108 of file StringMetric.hpp.
|
inline |
Get the current value.
Definition at line 130 of file StringMetric.hpp.
|
inlinestatic |
Definition at line 57 of file StringMetric.hpp.
|
protected |
Definition at line 72 of file StringMetric.hpp.
|
protected |
Definition at line 70 of file StringMetric.hpp.
|
protected |
Definition at line 71 of file StringMetric.hpp.