Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Szegoo committed Oct 15, 2022
1 parent 0679a4a commit cbca2c2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion client/sysinfo/src/sysinfo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ impl fmt::Display for Throughput {
}
}

/// Serializes `Throughput` and uses MiBs as the unit.
pub fn serialize_throughput_as_mibs<S>(
throughput: &Throughput,
serializer: S,
Expand All @@ -125,6 +126,7 @@ where
serializer.serialize_u64(throughput.as_mibs() as u64)
}

/// Serializes `Option<Throughput>` and uses MiBs as the unit.
pub fn serialize_throughput_option_as_mibs<S>(
maybe_throughput: &Option<Throughput>,
serializer: S,
Expand Down Expand Up @@ -164,7 +166,7 @@ pub(crate) fn benchmark<E>(
}
}

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,
Expand Down

0 comments on commit cbca2c2

Please sign in to comment.