diff --git a/src/connection.rs b/src/connection.rs index 9328422..b18cdc5 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -245,6 +245,7 @@ pub struct PlotConfiguration { #[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq, Hash)] pub enum Throughput { Bytes(u64), + BytesDecimal(u64), Elements(u64), } diff --git a/src/message_formats/json.rs b/src/message_formats/json.rs index a5418ee..9b15431 100644 --- a/src/message_formats/json.rs +++ b/src/message_formats/json.rs @@ -23,7 +23,7 @@ struct Throughput { impl From<&ThroughputEnum> for Throughput { fn from(other: &ThroughputEnum) -> Self { match other { - ThroughputEnum::Bytes(bytes) => Throughput { + ThroughputEnum::Bytes(bytes) | ThroughputEnum::BytesDecimal(bytes) => Throughput { per_iteration: *bytes, unit: "bytes".to_owned(), }, diff --git a/src/report.rs b/src/report.rs index b02e609..4677dda 100644 --- a/src/report.rs +++ b/src/report.rs @@ -154,7 +154,9 @@ impl BenchmarkId { pub fn as_number(&self) -> Option { match self.throughput { - Some(Throughput::Bytes(n)) | Some(Throughput::Elements(n)) => Some(n as f64), + Some(Throughput::Bytes(n)) + | Some(Throughput::BytesDecimal(n)) + | Some(Throughput::Elements(n)) => Some(n as f64), None => self .value_str .as_ref() @@ -164,7 +166,7 @@ impl BenchmarkId { pub fn value_type(&self) -> Option { match self.throughput { - Some(Throughput::Bytes(_)) => Some(ValueType::Bytes), + Some(Throughput::Bytes(_)) | Some(Throughput::BytesDecimal(_)) => Some(ValueType::Bytes), Some(Throughput::Elements(_)) => Some(ValueType::Elements), None => self .value_str