fix(falco_metrics): make duration_sec a count and not a timestamp

The output will thus be a total which is what this metrics is.

Signed-off-by: Samuel Gaist <samuel.gaist@idiap.ch>
This commit is contained in:
Samuel Gaist 2024-04-24 09:30:29 +02:00 committed by poiana
parent 2ae6103ab6
commit 82c914c11d

View File

@ -117,7 +117,7 @@ std::string falco_metrics::to_text(const falco::app::state& state)
static_metrics.push_back(libs_metrics_collector.new_metric("duration_sec",
METRICS_V2_MISC,
METRIC_VALUE_TYPE_U64,
METRIC_VALUE_UNIT_TIME_TIMESTAMP_NS,
METRIC_VALUE_UNIT_TIME_S_COUNT,
METRIC_VALUE_METRIC_TYPE_NON_MONOTONIC_CURRENT,
(uint64_t)((now - agent_info->start_ts_epoch) / ONE_SECOND_IN_NS)));