From cbca2c2c1e05288de38c741db25f8a72c4c44664 Mon Sep 17 00:00:00 2001 From: Szegoo Date: Sat, 15 Oct 2022 10:03:08 +0200 Subject: [PATCH] fix --- client/sysinfo/src/sysinfo.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client/sysinfo/src/sysinfo.rs b/client/sysinfo/src/sysinfo.rs index 47de7a18bd310..98d529c71f1dd 100644 --- a/client/sysinfo/src/sysinfo.rs +++ b/client/sysinfo/src/sysinfo.rs @@ -115,6 +115,7 @@ impl fmt::Display for Throughput { } } +/// Serializes `Throughput` and uses MiBs as the unit. pub fn serialize_throughput_as_mibs( throughput: &Throughput, serializer: S, @@ -125,6 +126,7 @@ where serializer.serialize_u64(throughput.as_mibs() as u64) } +/// Serializes `Option` and uses MiBs as the unit. pub fn serialize_throughput_option_as_mibs( maybe_throughput: &Option, serializer: S, @@ -164,7 +166,7 @@ pub(crate) fn benchmark( } } - let score = Throughput((size * count) as f64 / elapsed.as_secs_f64()); + let score = Throughput::from_mibs((size * count) as f64 / elapsed.as_secs_f64()); log::trace!( "Calculated {} of {} in {} iterations in {}ms", name,