Seastar
High performance C++ framework for concurrent servers
|
holds the metric definition.
Add multiple metric groups definitions. Initialization can be done in the constructor or with a call to add_group
#include <seastar/core/metrics_registration.hh>
Public Member Functions | |
metric_groups (metric_groups &&)=default | |
metric_groups & | operator= (metric_groups &&)=default |
metric_groups (std::initializer_list< metric_group_definition > mg) | |
add metrics belong to the same group in the constructor. More... | |
metric_groups & | add_group (const group_name_type &name, const std::initializer_list< metric_definition > &l) |
Add metrics belonging to the same group. More... | |
metric_groups & | add_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. | |
seastar::metrics::metric_groups::metric_groups | ( | std::initializer_list< metric_group_definition > | mg | ) |
add metrics belong to the same group in the constructor.
combine the constructor with the add_group functionality.
metric_groups& seastar::metrics::metric_groups::add_group | ( | const group_name_type & | name, |
const std::initializer_list< metric_definition > & | l | ||
) |
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.
metric_groups& seastar::metrics::metric_groups::add_group | ( | const group_name_type & | name, |
const std::vector< metric_definition > & | l | ||
) |
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);