Skip to main content
Pigweed's logo Pigweed
code_xml
  1. Home
  2. Reference
  3. C/C++
  4. Observability
  5. pw_metric
  6. pw::metric::Group Class Reference
Loading...
Searching...
No Matches
pw::metric::Group Class Reference

Overview

A metric tree consisting of children groups and leaf metrics.

Size: 16 bytes / 128 bits on 32-bit platforms - next, name, metrics, children.

Inheritance diagram for pw::metric::Group:

Public Member Functions

 Group (Token name)
 
 Group (Token name, GroupList &groups)
 
Token name () const
 
 Group (Group const &)=delete
 
void operator= (const Group &)=delete
 
void Add (UntypedMetric &metric)
 
void Add (Group &group)
 
MetricList & metrics ()
 
GroupList & children ()
 
const MetricList & metrics () const
 
const GroupList & children () const
 
void Dump () const
 

Static Public Member Functions

static void Dump (const GroupList &groups, int indent_level=0)
 

Member Function Documentation

◆ Dump()

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:

"$6doqFw==": {
"$05OCZw==": {
"$VpPfzg==": 1,
"$LGPMBQ==": 1.000000,
"$+iJvUg==": 5
},
"$9hPNxw==": 65,
"$oK7HmA==": 13,
"$FCM4qQ==": 0
}

Note the metric names are tokenized with base64. Decoding requires using the Pigweed detokenizer. With a detokenizing-enabled logger, you could get something like:

"i2c_1": {
"gyro": {
"num_sampleses": 1,
"init_time_us": 1.000000,
"initialized": 5,
}
"bus_errors": 65,
"transactions": 13,
"bytes_sent": 0,
}

The documentation for this class was generated from the following file: