Skip to content

Commit

Permalink
cleanup(metrics): remove duplicated new_metric method
Browse files Browse the repository at this point in the history
Signed-off-by: Mauro Ezequiel Moltrasio <[email protected]>
  • Loading branch information
Molter73 authored and poiana committed Aug 5, 2024
1 parent 9bda461 commit 1feeb37
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions userspace/libsinsp/metrics_collector.h
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ class libsinsp_metrics
}
}

/*!
\brief Method to create a new metrics_v2
*/
template <typename T>
static inline metrics_v2 new_metric(const char* name, uint32_t flags, metrics_v2_value_type type, metrics_v2_value_unit unit, metrics_v2_metric_type metric_type, T val)
{
Expand Down Expand Up @@ -333,22 +336,6 @@ class libs_metrics_collector
*/
std::vector<metrics_v2>& get_metrics();

/*!
\brief Method to create a new metrics_v2
*/
template <typename T>
metrics_v2 new_metric(const char* name, uint32_t flags, metrics_v2_value_type type, metrics_v2_value_unit unit, metrics_v2_metric_type metric_type, T val)
{
metrics_v2 metric;
strlcpy(metric.name, name, METRIC_NAME_MAX);
metric.flags = flags;
metric.type = type;
metric.unit = unit;
metric.metric_type = metric_type;
libsinsp_metrics::set_metric_value(metric, type, val);
return metric;
}

private:
sinsp* m_inspector;
std::shared_ptr<sinsp_stats_v2> m_sinsp_stats_v2;
Expand Down

0 comments on commit 1feeb37

Please sign in to comment.