Skip to content

Commit

Permalink
fix(falco_metrics): make duration_sec and outputs_queue_num_drops mon…
Browse files Browse the repository at this point in the history
…otonic

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
  • Loading branch information
sgaist committed Apr 24, 2024
1 parent b587754 commit 815af40
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions userspace/falco/falco_metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ std::string falco_metrics::to_text(const falco::app::state& state)
METRICS_V2_MISC,
METRIC_VALUE_TYPE_U64,
METRIC_VALUE_UNIT_COUNT,
METRIC_VALUE_METRIC_TYPE_NON_MONOTONIC_CURRENT,
METRIC_VALUE_METRIC_TYPE_MONOTONIC,
state.outputs->get_outputs_queue_num_drops()));

auto now = std::chrono::duration_cast<std::chrono::nanoseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
Expand All @@ -118,7 +118,7 @@ std::string falco_metrics::to_text(const falco::app::state& state)
METRICS_V2_MISC,
METRIC_VALUE_TYPE_U64,
METRIC_VALUE_UNIT_TIME_S_COUNT,
METRIC_VALUE_METRIC_TYPE_NON_MONOTONIC_CURRENT,
METRIC_VALUE_METRIC_TYPE_MONOTONIC,
(uint64_t)((now - agent_info->start_ts_epoch) / ONE_SECOND_IN_NS)));

for (auto metrics: static_metrics)
Expand Down

0 comments on commit 815af40

Please sign in to comment.