pub struct LoadShape {Show 15 fields
pub shape_type: LoadShapeType,
pub metric: Option<LoadShapeMetric>,
pub curve: Option<RampCurve>,
pub baseline: Option<f64>,
pub peak: Option<f64>,
pub ramp_up_millis: Option<u64>,
pub hold_millis: Option<u64>,
pub ramp_down_millis: Option<u64>,
pub recovery_hold_millis: Option<u64>,
pub start: Option<f64>,
pub step: Option<f64>,
pub steps: Option<u32>,
pub step_duration_millis: Option<u64>,
pub target: Option<f64>,
pub ramp_millis: Option<u64>,
}Expand description
A declarative named load shape that expands into ordinary LoadStages.
Maps to the LoadShape schema. Only the parameters its type needs are
read; the rest are ignored. Use a shape OR an explicit stages list, not
both.
Use the constructors LoadShape::spike, LoadShape::stairs and
LoadShape::ramp_hold so only the relevant fields are set (and therefore
serialized).
Fields§
§shape_type: LoadShapeTypeThe named shape — SPIKE, STAIRS or RAMP_HOLD.
metric: Option<LoadShapeMetric>What the shape drives — VU (default) or RATE.
curve: Option<RampCurve>Ramp interpolation curve used by the shape’s ramps.
baseline: Option<f64>SPIKE: the level held before and after the spike.
peak: Option<f64>SPIKE: the level held at the top of the spike.
ramp_up_millis: Option<u64>SPIKE: duration of the baseline to peak ramp.
hold_millis: Option<u64>SPIKE: duration to hold at the peak; RAMP_HOLD: duration to hold at the target.
ramp_down_millis: Option<u64>SPIKE: duration of the peak to baseline ramp.
recovery_hold_millis: Option<u64>SPIKE (optional): duration to hold at baseline after the down ramp.
start: Option<f64>STAIRS: the level of the first step.
step: Option<f64>STAIRS: how much each step rises above the previous one.
steps: Option<u32>STAIRS: the number of steps.
step_duration_millis: Option<u64>STAIRS: how long each step holds at its level.
target: Option<f64>RAMP_HOLD: the level ramped up to (from 0) and then held.
ramp_millis: Option<u64>RAMP_HOLD: duration of the 0 to target ramp.
Implementations§
Source§impl LoadShape
impl LoadShape
Sourcepub fn spike(
baseline: f64,
peak: f64,
ramp_up_millis: u64,
hold_millis: u64,
ramp_down_millis: u64,
) -> Self
pub fn spike( baseline: f64, peak: f64, ramp_up_millis: u64, hold_millis: u64, ramp_down_millis: u64, ) -> Self
A SPIKE shape: ramp baseline to peak over ramp_up_millis, hold for
hold_millis, then ramp back down over ramp_down_millis.
Sourcepub fn stairs(
start: f64,
step: f64,
steps: u32,
step_duration_millis: u64,
) -> Self
pub fn stairs( start: f64, step: f64, steps: u32, step_duration_millis: u64, ) -> Self
A STAIRS shape: steps pure-hold steps, the first at start and each
rising by step, every step holding for step_duration_millis.
Sourcepub fn ramp_hold(target: f64, ramp_millis: u64, hold_millis: u64) -> Self
pub fn ramp_hold(target: f64, ramp_millis: u64, hold_millis: u64) -> Self
A RAMP_HOLD shape: ramp from 0 to target over ramp_millis, then hold
for hold_millis.
Sourcepub fn metric(self, metric: LoadShapeMetric) -> Self
pub fn metric(self, metric: LoadShapeMetric) -> Self
Set what the shape drives (VU or RATE).
Sourcepub fn recovery_hold_millis(self, recovery_hold_millis: u64) -> Self
pub fn recovery_hold_millis(self, recovery_hold_millis: u64) -> Self
SPIKE only: hold at baseline for recovery_hold_millis after the down
ramp.