Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Harring committed Mar 14, 2022
1 parent 777fc33 commit 275bad5
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions src/dataflow/src/source/kafka/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,24 @@ impl KafkaPartitionMetrics {
let pm = &base.partition_specific;
Self {
partition_offset_map: HashMap::from_iter(ids.iter().map(|id| {
let labels = &[topic.clone(), source_name.clone(), source_id.to_string(), format!("{}", id)];
(*id, pm.partition_offset_max.get_delete_on_drop_gauge(labels.to_vec()))
let labels = &[
topic.clone(),
source_name.clone(),
source_id.to_string(),
format!("{}", id),
];
(
*id,
pm.partition_offset_max
.get_delete_on_drop_gauge(labels.to_vec()),
)
})),
}
}

pub fn set_offset_max(&self, id: i32, offset: i64) {
self.partition_offset_map.get(&id).and_then(|g| Some(g.set(offset)));
self.partition_offset_map
.get(&id)
.and_then(|g| Some(g.set(offset)));
}
}

0 comments on commit 275bad5

Please sign in to comment.