Seastar
High performance C++ framework for concurrent servers
Public Member Functions | List of all members
seastar::metrics::metric_group Class Reference

Detailed Description

hold a single metric group Initialization is done in the constructor or with a call to add_group

#include <seastar/core/metrics_registration.hh>

Inheritance diagram for seastar::metrics::metric_group:
seastar::metrics::metric_groups

Public Member Functions

 metric_group (const metric_group &)=delete
 
 metric_group (metric_group &&)=default
 
metric_groupoperator= (metric_group &&)=default
 
 metric_group (const group_name_type &name, std::initializer_list< metric_definition > l)
 add metrics belong to the same group in the constructor.
 
metric_groupsadd_group (const group_name_type &name, const std::initializer_list< metric_definition > &l)
 Add metrics belonging to the same group. More...
 
metric_groupsadd_group (const group_name_type &name, const std::vector< metric_definition > &l)
 Add metrics belonging to the same group. More...
 
void clear ()
 clear all metrics groups registrations.
 

Member Function Documentation

◆ add_group() [1/2]

metric_groups& seastar::metrics::metric_groups::add_group ( const group_name_type name,
const std::initializer_list< metric_definition > &  l 
)
inherited

Add metrics belonging to the same group.

Use the metrics creation functions to add metrics.

For example: _metrics.add_group("my_group", { make_counter("my_counter_name1", counter, description("my counter description")), make_counter("my_counter_name2", counter, description("my second counter description")), make_gauge("my_gauge_name1", gauge, description("my gauge description")), });

Metric name should be unique inside the group. You can chain add_group calls like: _metrics.add_group("my group1", {...}).add_group("my group2", {...});

This overload (with initializer_list) is needed because metric_definition has no copy constructor, so the other overload (with vector) cannot be invoked on a braced-init-list.

◆ add_group() [2/2]

metric_groups& seastar::metrics::metric_groups::add_group ( const group_name_type name,
const std::vector< metric_definition > &  l 
)
inherited

Add metrics belonging to the same group.

Use the metrics creation functions to add metrics.

For example: vector<metric_definition> v; v.push_back(make_counter("my_counter_name1", counter, description("my counter description"))); v.push_back(make_counter("my_counter_name2", counter, description("my second counter description"))); v.push_back(make_gauge("my_gauge_name1", gauge, description("my gauge description"))); _metrics.add_group("my_group", v);

Metric name should be unique inside the group. You can chain add_group calls like: _metrics.add_group("my group1", vec1).add_group("my group2", vec2);


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