mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 09:08:20 +00:00
Add timer counts as telemetry metrics
This commit is contained in:
parent
4face43462
commit
44860676a2
2 changed files with 42 additions and 4 deletions
17
src/Timer.h
17
src/Timer.h
|
@ -10,7 +10,14 @@
|
|||
|
||||
namespace zeek {
|
||||
class ODesc;
|
||||
}
|
||||
|
||||
namespace telemetry {
|
||||
class Gauge;
|
||||
class Counter;
|
||||
using GaugePtr = std::shared_ptr<Gauge>;
|
||||
using CounterPtr = std::shared_ptr<Counter>;
|
||||
} // namespace telemetry
|
||||
} // namespace zeek
|
||||
|
||||
namespace zeek::detail {
|
||||
|
||||
|
@ -153,10 +160,12 @@ private:
|
|||
// for the max_timer_expires=0 case.
|
||||
bool dispatch_all_expired = false;
|
||||
|
||||
size_t peak_size = 0;
|
||||
size_t cumulative_num = 0;
|
||||
|
||||
static unsigned int current_timers[NUM_TIMER_TYPES];
|
||||
|
||||
telemetry::CounterPtr cumulative_num_metric;
|
||||
telemetry::GaugePtr lag_time_metric;
|
||||
telemetry::GaugePtr current_timer_metrics[NUM_TIMER_TYPES];
|
||||
|
||||
std::unique_ptr<PriorityQueue> q;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue