Skip to content

Commit

Permalink
Rust fmt (#5169)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulmicoton authored Jun 26, 2024
1 parent 20b1200 commit acc1e1b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 9 deletions.
16 changes: 10 additions & 6 deletions quickwit/quickwit-indexing/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@

use once_cell::sync::Lazy;
use quickwit_common::metrics::{
new_counter, new_counter_vec, new_gauge, new_gauge_vec, IntCounter, IntCounterVec, IntGauge, IntGaugeVec
new_counter, new_counter_vec, new_gauge, new_gauge_vec, IntCounter, IntCounterVec, IntGauge,
IntGaugeVec,
};

pub struct IndexerMetrics {
Expand Down Expand Up @@ -93,11 +94,14 @@ impl Default for IndexerMetrics {
"indexing",
&[],
),
kafka_rebalance_total: Lazy::new(|| new_counter(
"kafka_rebalance_total",
"Number of kafka rebalances",
"indexing",
)),
kafka_rebalance_total: Lazy::new(|| {
new_counter(
"kafka_rebalance_total",
"Number of kafka rebalances",
"indexing",
&[],
)
}),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion quickwit/quickwit-indexing/src/source/kafka_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ macro_rules! return_if_err {
impl ConsumerContext for RdKafkaContext {
fn pre_rebalance(&self, rebalance: &Rebalance) {
crate::metrics::INDEXER_METRICS.kafka_rebalance_total.inc();
quickwit_common::rate_limited_info!(limit_per_min=3, topic=self.topic, "rebalance");
quickwit_common::rate_limited_info!(limit_per_min = 3, topic = self.topic, "rebalance");
if let Rebalance::Revoke(tpl) = rebalance {
let partitions = collect_partitions(tpl, &self.topic);
debug!(partitions=?partitions, "revoke partitions");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,11 @@ impl FileBackedIndex {
.checkpoint
.try_apply_delta(checkpoint_delta)
.map_err(|error| {
quickwit_common::rate_limited_error!(limit_per_min=6, index=self.index_id(), "failed to apply checkpoint delta");
quickwit_common::rate_limited_error!(
limit_per_min = 6,
index = self.index_id(),
"failed to apply checkpoint delta"
);
let entity = EntityKind::CheckpointDelta {
index_id: self.index_id().to_string(),
source_id,
Expand Down
5 changes: 4 additions & 1 deletion quickwit/quickwit-proto/src/metastore/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,10 @@ impl GrpcServiceError for MetastoreError {
}

fn new_too_many_requests() -> Self {
quickwit_common::rate_limited_error!(limit_per_min=6, "metastore error: too many requests");
quickwit_common::rate_limited_error!(
limit_per_min = 6,
"metastore error: too many requests"
);
Self::TooManyRequests
}

Expand Down

0 comments on commit acc1e1b

Please sign in to comment.