Seastar
High performance C++ framework for concurrent servers
|
hold a single metric group Initialization is done in the constructor or with a call to add_group
#include <seastar/core/metrics_registration.hh>
Public Member Functions | |
metric_group (const metric_group &)=delete | |
metric_group (metric_group &&)=default | |
metric_group & | operator= (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_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. | |
|
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.
|
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);