pub struct EnergyMetrics {
pub total_joules: f64,
pub average_power_watts: f64,
pub peak_power_watts: f64,
pub duration_seconds: f64,
pub co2_grams: Option<f64>,
pub pue: f64,
}Expand description
Energy consumption metrics
Fields§
§total_joules: f64Total energy consumed in joules
average_power_watts: f64Average power draw in watts
peak_power_watts: f64Peak power draw in watts
duration_seconds: f64Duration of measurement in seconds
co2_grams: Option<f64>CO2 equivalent emissions in grams (based on grid carbon intensity)
pue: f64Power Usage Effectiveness (datacenter overhead)
Implementations§
Source§impl EnergyMetrics
impl EnergyMetrics
Sourcepub fn new(
total_joules: f64,
average_power_watts: f64,
peak_power_watts: f64,
duration_seconds: f64,
) -> EnergyMetrics
pub fn new( total_joules: f64, average_power_watts: f64, peak_power_watts: f64, duration_seconds: f64, ) -> EnergyMetrics
Create new energy metrics
Sourcepub fn with_carbon_intensity(
self,
carbon_intensity_g_per_kwh: f64,
) -> EnergyMetrics
pub fn with_carbon_intensity( self, carbon_intensity_g_per_kwh: f64, ) -> EnergyMetrics
Calculate CO2 emissions based on carbon intensity (g CO2/kWh)
Sourcepub fn with_pue(self, pue: f64) -> EnergyMetrics
pub fn with_pue(self, pue: f64) -> EnergyMetrics
Set the Power Usage Effectiveness factor
Sourcepub fn flops_per_watt(&self, total_flops: f64) -> f64
pub fn flops_per_watt(&self, total_flops: f64) -> f64
Calculate energy efficiency in FLOPS per watt
Trait Implementations§
Source§impl Clone for EnergyMetrics
impl Clone for EnergyMetrics
Source§fn clone(&self) -> EnergyMetrics
fn clone(&self) -> EnergyMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EnergyMetrics
impl Debug for EnergyMetrics
Source§impl<'de> Deserialize<'de> for EnergyMetrics
impl<'de> Deserialize<'de> for EnergyMetrics
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<EnergyMetrics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<EnergyMetrics, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EnergyMetrics
impl PartialEq for EnergyMetrics
Source§impl Serialize for EnergyMetrics
impl Serialize for EnergyMetrics
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for EnergyMetrics
Auto Trait Implementations§
impl Freeze for EnergyMetrics
impl RefUnwindSafe for EnergyMetrics
impl Send for EnergyMetrics
impl Sync for EnergyMetrics
impl Unpin for EnergyMetrics
impl UnsafeUnpin for EnergyMetrics
impl UnwindSafe for EnergyMetrics
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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