Enum snarkos_metrics::Unit [−][src]
pub enum Unit {
Show 17 variants
Count,
Percent,
Seconds,
Milliseconds,
Microseconds,
Nanoseconds,
Tebibytes,
Gigibytes,
Mebibytes,
Kibibytes,
Bytes,
TerabitsPerSecond,
GigabitsPerSecond,
MegabitsPerSecond,
KilobitsPerSecond,
BitsPerSecond,
CountPerSecond,
}
Expand description
Units for a given metric.
While metrics do not necessarily need to be tied to a particular unit to be recorded, some downstream systems natively support defining units and so they can be specified during registration.
Variants
Count.
Percentage.
Seconds.
One second is equal to 1000 milliseconds.
Milliseconds.
One millisecond is equal to 1000 microseconds.
Microseconds.
One microsecond is equal to 1000 nanoseconds.
Nanoseconds.
Tebibytes.
One tebibyte is equal to 1024 gigibytes.
Gigibytes.
One gigibyte is equal to 1024 mebibytes.
Mebibytes.
One mebibyte is equal to 1024 kibibytes.
Kibibytes.
One kibibyte is equal to 1024 bytes.
Bytes.
Terabits per second.
One terabit is equal to 1000 gigabits.
Gigabits per second.
One gigabit is equal to 1000 megabits.
Megabits per second.
One megabit is equal to 1000 kilobits.
Kilobits per second.
One kilobit is equal to 1000 bits.
Bits per second.
Count per second.
Implementations
Gets the canonical string label for the given unit.
For example, the canonical label for Seconds
would be s
, while for Nanoseconds
,
it would be ns
.
Not all units have a meaningful display label and so some may be empty.
Converts the string representation of a unit back into Unit
if possible.
The value passed here should match the output of Unit::as_str
.
Whether or not this unit relates to the measurement of time.
Whether or not this unit relates to the measurement of data.
Whether or not this unit relates to the measurement of data rates.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Unit
impl UnwindSafe for Unit
Blanket Implementations
Mutably borrows from an owned value. Read more