add Display for ByteCount (#1949)

* add Display for ByteCount

* export missing AggregationLimits
This commit is contained in:
PSeitz
2023-03-21 15:02:35 +08:00
committed by GitHub
parent 6a7a1106d6
commit 8f7f1d6be4
2 changed files with 7 additions and 0 deletions

View File

@@ -13,6 +13,12 @@ impl std::fmt::Debug for ByteCount {
}
}
impl std::fmt::Display for ByteCount {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str(&self.human_readable())
}
}
const SUFFIX_AND_THRESHOLD: [(&str, u64); 5] = [
("KB", 1_000),
("MB", 1_000_000),

View File

@@ -174,6 +174,7 @@ use std::fmt::Display;
#[cfg(test)]
mod agg_tests;
pub use agg_limits::AggregationLimits;
pub use collector::{
AggregationCollector, AggregationSegmentCollector, DistributedAggregationCollector,
DEFAULT_BUCKET_LIMIT,