mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Avoid capturing 'this' for callback in telemetry::Manager
This commit is contained in:
parent
73f71e652d
commit
7a1eb78b67
1 changed files with 5 additions and 5 deletions
|
@ -112,14 +112,14 @@ void Manager::InitPostScript() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_PROCESS_STAT_METRICS
|
#ifdef HAVE_PROCESS_STAT_METRICS
|
||||||
static auto get_stats = [this]() -> const detail::process_stats* {
|
static auto get_stats = []() -> const detail::process_stats* {
|
||||||
double now = util::current_time();
|
double now = util::current_time();
|
||||||
if ( this->process_stats_last_updated < now - 0.01 ) {
|
if ( telemetry_mgr->process_stats_last_updated < now - 0.01 ) {
|
||||||
this->current_process_stats = detail::get_process_stats();
|
telemetry_mgr->current_process_stats = detail::get_process_stats();
|
||||||
this->process_stats_last_updated = now;
|
telemetry_mgr->process_stats_last_updated = now;
|
||||||
}
|
}
|
||||||
|
|
||||||
return &this->current_process_stats;
|
return &telemetry_mgr->current_process_stats;
|
||||||
};
|
};
|
||||||
rss_gauge = GaugeInstance("process", "resident_memory", {}, "Resident memory size", "bytes",
|
rss_gauge = GaugeInstance("process", "resident_memory", {}, "Resident memory size", "bytes",
|
||||||
[]() -> prometheus::ClientMetric {
|
[]() -> prometheus::ClientMetric {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue