Skip to content

Commit

Permalink
actually use correct metric name
Browse files Browse the repository at this point in the history
  • Loading branch information
derklaro committed Oct 20, 2023
1 parent 18afe59 commit c7c37ae
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions openmetrics_udpserver/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,24 +51,22 @@ impl Processor {
if self.config.debug {
println!(
"got metric [type={:?}, name={}, count={}]",
&inbound_metric.metric_type,
&inbound_metric.name,
&inbound_metric.count
&inbound_metric.metric_type, &metric_name, &inbound_metric.count
);
}

match inbound_metric.metric_type {
MetricType::Min | MetricType::Average | MetricType::Peak => {
let metric = self
.get_or_register_metric(&inbound_metric.name, || {
.get_or_register_metric(&metric_name, || {
ResettingSingleValMetric::default()
})
.unwrap();
metric.observe(inbound_metric.count);
}
MetricType::Sum => {
let metric = self
.get_or_register_metric(&inbound_metric.name, || {
.get_or_register_metric(&metric_name, || {
ResettingCounterMetric::default()
})
.unwrap();
Expand Down

0 comments on commit c7c37ae

Please sign in to comment.