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 63 of file StringMetric.hpp.
|
protected |
Definition at line 80 of file StringMetric.hpp.
anonymous enum |
Enumerator | |
---|---|
max_string_size |
Definition at line 65 of file StringMetric.hpp.
|
inline |
Definition at line 93 of file StringMetric.hpp.
|
inlinevirtual |
Definition at line 126 of file StringMetric.hpp.
|
inlinevirtual |
Definition at line 106 of file StringMetric.hpp.
|
virtual |
Definition at line 10 of file StringMetricImpl.hpp.
|
inline |
Definition at line 151 of file StringMetric.hpp.
|
inline |
Definition at line 144 of file StringMetric.hpp.
|
inline |
Definition at line 153 of file StringMetric.hpp.
|
inlinevirtual |
Definition at line 111 of file StringMetric.hpp.
|
inlinevirtual |
Definition at line 119 of file StringMetric.hpp.
|
inline |
Get the current value.
Definition at line 141 of file StringMetric.hpp.
|
inlinestatic |
Definition at line 68 of file StringMetric.hpp.
|
protected |
Definition at line 83 of file StringMetric.hpp.
|
protected |
Definition at line 81 of file StringMetric.hpp.
|
protected |
Definition at line 82 of file StringMetric.hpp.