Skip to content

Commit 146fab6

Browse files
committed
Format code
1 parent e3f1af1 commit 146fab6

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

src/metrics/latency_metric.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -408,9 +408,9 @@ macro_rules! percentile_latency_metric {
408408
pub(crate) fn serialize_sketch(&self) -> Result<Vec<u8>> {
409409
let sketch = self.inner.lock().unwrap();
410410
bincode::serialize(&*sketch).map_err(|e| {
411-
datafusion::error::DataFusionError::Internal(
412-
format!("failed to serialize DDSketch: {e}"),
413-
)
411+
datafusion::error::DataFusionError::Internal(format!(
412+
"failed to serialize DDSketch: {e}"
413+
))
414414
})
415415
}
416416

src/metrics/proto.rs

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -749,10 +749,9 @@ pub fn metric_proto_to_df(metric: MetricProto) -> Result<Arc<Metric>, DataFusion
749749
)))
750750
}
751751
Some(MetricValueProto::CustomP50Latency(p)) => {
752-
let sketch: DDSketch = bincode::deserialize(&p.sketch_bytes)
753-
.map_err(|e| {
754-
DataFusionError::Internal(format!("failed to deserialize DDSketch: {e}"))
755-
})?;
752+
let sketch: DDSketch = bincode::deserialize(&p.sketch_bytes).map_err(|e| {
753+
DataFusionError::Internal(format!("failed to deserialize DDSketch: {e}"))
754+
})?;
756755
let value = P50LatencyMetric::from_sketch(sketch);
757756
Ok(Arc::new(Metric::new_with_labels(
758757
MetricValue::Custom {
@@ -764,10 +763,9 @@ pub fn metric_proto_to_df(metric: MetricProto) -> Result<Arc<Metric>, DataFusion
764763
)))
765764
}
766765
Some(MetricValueProto::CustomP75Latency(p)) => {
767-
let sketch: DDSketch = bincode::deserialize(&p.sketch_bytes)
768-
.map_err(|e| {
769-
DataFusionError::Internal(format!("failed to deserialize DDSketch: {e}"))
770-
})?;
766+
let sketch: DDSketch = bincode::deserialize(&p.sketch_bytes).map_err(|e| {
767+
DataFusionError::Internal(format!("failed to deserialize DDSketch: {e}"))
768+
})?;
771769
let value = P75LatencyMetric::from_sketch(sketch);
772770
Ok(Arc::new(Metric::new_with_labels(
773771
MetricValue::Custom {
@@ -779,10 +777,9 @@ pub fn metric_proto_to_df(metric: MetricProto) -> Result<Arc<Metric>, DataFusion
779777
)))
780778
}
781779
Some(MetricValueProto::CustomP95Latency(p)) => {
782-
let sketch: DDSketch = bincode::deserialize(&p.sketch_bytes)
783-
.map_err(|e| {
784-
DataFusionError::Internal(format!("failed to deserialize DDSketch: {e}"))
785-
})?;
780+
let sketch: DDSketch = bincode::deserialize(&p.sketch_bytes).map_err(|e| {
781+
DataFusionError::Internal(format!("failed to deserialize DDSketch: {e}"))
782+
})?;
786783
let value = P95LatencyMetric::from_sketch(sketch);
787784
Ok(Arc::new(Metric::new_with_labels(
788785
MetricValue::Custom {
@@ -794,10 +791,9 @@ pub fn metric_proto_to_df(metric: MetricProto) -> Result<Arc<Metric>, DataFusion
794791
)))
795792
}
796793
Some(MetricValueProto::CustomP99Latency(p)) => {
797-
let sketch: DDSketch = bincode::deserialize(&p.sketch_bytes)
798-
.map_err(|e| {
799-
DataFusionError::Internal(format!("failed to deserialize DDSketch: {e}"))
800-
})?;
794+
let sketch: DDSketch = bincode::deserialize(&p.sketch_bytes).map_err(|e| {
795+
DataFusionError::Internal(format!("failed to deserialize DDSketch: {e}"))
796+
})?;
801797
let value = P99LatencyMetric::from_sketch(sketch);
802798
Ok(Arc::new(Metric::new_with_labels(
803799
MetricValue::Custom {

0 commit comments

Comments
 (0)