A metric tree consisting of children groups and leaf metrics.
Size: 16 bytes / 128 bits on 32-bit platforms - next, name, metrics, children.
Public Member Functions | |
| constexpr | Group (Token name) |
| constexpr | Group (Token name, GroupList &groups) |
| constexpr Token | name () const |
| Returns this group's tokenized name. | |
| Group (Group const &)=delete | |
| void | operator= (const Group &)=delete |
| constexpr void | Add (UntypedMetric &metric) |
| constexpr void | Add (Group &group) |
| constexpr MetricList & | metrics () |
| Returns the mutable list of metrics in this group. | |
| constexpr GroupList & | children () |
| Returns the mutable list of child groups in this group. | |
| constexpr const MetricList & | metrics () const |
| Returns the list of metrics in this group. | |
| constexpr const GroupList & | children () const |
| Returns the list of child groups in this group. | |
| void | Dump () const |
Static Public Member Functions | |
| static void | Dump (const GroupList &groups, int indent_level=0) |
|
inlineconstexpr |
Constructs an empty, unregistered metric group with the given tokenized name.
| [in] | name | Tokenized name of this metric group. |
|
inlineconstexpr |
Constructs a metric group with the given tokenized name and registers it in groups.
| [in] | name | Tokenized name of this metric group. |
| [in,out] | groups | Parent or global group list to register with. |
groups must already be initialized, and any concurrent access to groups must be externally synchronized.
|
inlineconstexpr |
Adds child group to this group's children list.
| [in,out] | group | Child group to add to this group's children list. |
group must not already belong to a list, and concurrent mutations of this group must be externally synchronized.
|
inlineconstexpr |
Adds metric to this group's metrics list.
| [in,out] | metric | Metric to add to this group's metrics list. |
metric must not already belong to a list, and concurrent mutations of this group must be externally synchronized. | void pw::metric::Group::Dump | ( | ) | const |
Recursively dump a metrics group or groups to pw_log. Level determines the indentation indent_level up to a maximum of 4. Produces output like:
Note the metric names are tokenized with base64. Decoding requires using the Pigweed detokenizer. With a detokenizing-enabled logger, you could get something like: