Skip to content

Commit

Permalink
redpanda/main: use scheduling groups probe
Browse files Browse the repository at this point in the history
This commit wires up a scheduling_groups_probe in order to publish
metrics based on the scheduling groups stats. Note how the probe is
cleared before the scheduling groups are destroyed to prevent publishing
metrics from a destroyed group.
  • Loading branch information
Vlad Lazar committed Aug 10, 2022
1 parent 957f116 commit e63aab2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/v/redpanda/application.cc
Original file line number Diff line number Diff line change
Expand Up @@ -294,8 +294,11 @@ void application::initialize(
}

_scheduling_groups.create_groups().get();
_deferred.emplace_back(
[this] { _scheduling_groups.destroy_groups().get(); });
_scheduling_groups_probe.wire_up(_scheduling_groups);
_deferred.emplace_back([this] {
_scheduling_groups_probe.clear();
_scheduling_groups.destroy_groups().get();
});

if (proxy_cfg) {
_proxy_config.emplace(*proxy_cfg);
Expand Down
2 changes: 2 additions & 0 deletions src/v/redpanda/application.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#include "redpanda/admin_server.h"
#include "resource_mgmt/cpu_scheduling.h"
#include "resource_mgmt/memory_groups.h"
#include "resource_mgmt/scheduling_groups_probe.h"
#include "resource_mgmt/smp_groups.h"
#include "rpc/fwd.h"
#include "seastarx.h"
Expand Down Expand Up @@ -157,6 +158,7 @@ class application {
_schema_reg_config;
std::optional<kafka::client::configuration> _schema_reg_client_config;
scheduling_groups _scheduling_groups;
scheduling_groups_probe _scheduling_groups_probe;
ss::logger _log;

ss::sharded<rpc::connection_cache> _connection_cache;
Expand Down

0 comments on commit e63aab2

Please sign in to comment.