pub struct CapacitySpec {
pub resource_name: String,
pub current_capacity: f64,
pub current_usage: f64,
pub growth_rate: f64,
pub headroom_factor: f64,
}Expand description
A capacity planning resource specification.
Fields§
§resource_name: String§current_capacity: f64§current_usage: f64§growth_rate: f64Expected growth rate per period (fraction, e.g. 0.1 = 10%).
headroom_factor: f64Safety headroom factor (e.g. 1.2 = 20% buffer).
Implementations§
Source§impl CapacitySpec
impl CapacitySpec
pub fn new( resource_name: &str, current_capacity: f64, current_usage: f64, growth_rate: f64, headroom_factor: f64, ) -> Self
pub fn utilization(&self) -> f64
Sourcepub fn predicted_usage(&self, periods: u32) -> f64
pub fn predicted_usage(&self, periods: u32) -> f64
Predicted usage after periods time periods with compound growth.
Sourcepub fn required_capacity(&self, periods: u32) -> f64
pub fn required_capacity(&self, periods: u32) -> f64
Required capacity to handle predicted usage with headroom.
Sourcepub fn periods_until_full(&self) -> Option<u32>
pub fn periods_until_full(&self) -> Option<u32>
Periods until capacity is breached (without headroom).
Trait Implementations§
Source§impl Clone for CapacitySpec
impl Clone for CapacitySpec
Source§fn clone(&self) -> CapacitySpec
fn clone(&self) -> CapacitySpec
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 moreAuto Trait Implementations§
impl Freeze for CapacitySpec
impl RefUnwindSafe for CapacitySpec
impl Send for CapacitySpec
impl Sync for CapacitySpec
impl Unpin for CapacitySpec
impl UnsafeUnpin for CapacitySpec
impl UnwindSafe for CapacitySpec
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