pub enum Throughput {
Bits(u64),
Bytes(u64),
BytesDecimal(u64),
Elements(u64),
ElementsAndBytes {
elements: u64,
bytes: u64,
},
}Expand description
Enum representing different ways of measuring the throughput of benchmarked code. If the throughput setting is configured for a benchmark then the estimated throughput will be reported as well as the time per iteration.
Variants§
Bits(u64)
Measure throughput in terms of bits/second. The value should be the number of bits processed by one iteration of the benchmarked code. Typically, this would be the number of bits transferred by a networking function.
Bytes(u64)
Measure throughput in terms of bytes/second. The value should be the number of bytes
processed by one iteration of the benchmarked code. Typically, this would be the length of
an input string or &[u8].
BytesDecimal(u64)
Equivalent to Bytes, but the value will be reported in terms of kilobytes (1000 bytes) per second instead of kibibytes (1024 bytes) per second, megabytes instead of mibibytes, and gigabytes instead of gibibytes.
Elements(u64)
Measure throughput in terms of elements/second. The value should be the number of elements processed by one iteration of the benchmarked code. Typically, this would be the size of a collection, but could also be the number of lines of input text or the number of values to parse.
ElementsAndBytes
Measure throughput in terms of both elements/second and bytes/second. Typically,
this would be used if you have a collection of rows where elements would be the length of
the collection and bytes would be the total size of the collection if you’re processing
the entire collection in one iteration. This will make sure the report simultaneously
includes on the rows/s and MB/s that data processing is able to achieve.
The elements are considered the “primary” throughput being reported on (i.e. what will appear
in the BenchmarkId).
Trait Implementations§
Source§impl Clone for Throughput
impl Clone for Throughput
Source§fn clone(&self) -> Throughput
fn clone(&self) -> Throughput
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Throughput
impl Debug for Throughput
Source§impl<'de> Deserialize<'de> for Throughput
impl<'de> Deserialize<'de> for Throughput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for Throughput
impl PartialEq for Throughput
Source§impl Serialize for Throughput
impl Serialize for Throughput
impl Eq for Throughput
impl StructuralPartialEq for Throughput
Auto Trait Implementations§
impl Freeze for Throughput
impl RefUnwindSafe for Throughput
impl Send for Throughput
impl Sync for Throughput
impl Unpin for Throughput
impl UnwindSafe for Throughput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more