pub enum Metric {
BinaryBytes,
CpuMs,
CtxSwitches,
EnergyUj,
IoReadBytes,
IoWriteBytes,
MaxRssKb,
NetworkPackets,
PageFaults,
ThroughputPerS,
WallMs,
}Variants§
BinaryBytes
CpuMs
CtxSwitches
EnergyUj
IoReadBytes
IoWriteBytes
MaxRssKb
NetworkPackets
PageFaults
ThroughputPerS
WallMs
Implementations§
Source§impl Metric
impl Metric
Sourcepub fn as_str(self) -> &'static str
pub fn as_str(self) -> &'static str
Returns the snake_case string key for this metric.
§Examples
use perfgate_types::Metric;
assert_eq!(Metric::WallMs.as_str(), "wall_ms");
assert_eq!(Metric::ThroughputPerS.as_str(), "throughput_per_s");Sourcepub fn default_direction(self) -> Direction
pub fn default_direction(self) -> Direction
Returns the default comparison direction for this metric.
Most metrics use Direction::Lower (lower is better), except
throughput which uses Direction::Higher.
§Examples
use perfgate_types::{Metric, Direction};
assert_eq!(Metric::WallMs.default_direction(), Direction::Lower);
assert_eq!(Metric::ThroughputPerS.default_direction(), Direction::Higher);pub fn default_warn_factor(self) -> f64
Sourcepub fn display_unit(self) -> &'static str
pub fn display_unit(self) -> &'static str
Returns the human-readable display unit for this metric.
§Examples
use perfgate_types::Metric;
assert_eq!(Metric::WallMs.display_unit(), "ms");
assert_eq!(Metric::MaxRssKb.display_unit(), "KB");
assert_eq!(Metric::ThroughputPerS.display_unit(), "/s");Trait Implementations§
Source§impl<'de> Deserialize<'de> for Metric
impl<'de> Deserialize<'de> for Metric
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Metric
impl JsonSchema for Metric
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl Ord for Metric
impl Ord for Metric
Source§impl PartialOrd for Metric
impl PartialOrd for Metric
impl Copy for Metric
impl Eq for Metric
impl StructuralPartialEq for Metric
Auto Trait Implementations§
impl Freeze for Metric
impl RefUnwindSafe for Metric
impl Send for Metric
impl Sync for Metric
impl Unpin for Metric
impl UnsafeUnpin for Metric
impl UnwindSafe for Metric
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
Mutably borrows from an owned value. Read more