pub enum WorkPhase {
Spin(Duration),
Sleep(Duration),
Yield(Duration),
Io(Duration),
AluHot {
width: AluWidth,
duration: Duration,
},
}Expand description
A single phase in a WorkType::Sequence compound work pattern.
Workers loop through all phases in order, then repeat. Each phase runs for its specified duration before advancing to the next.
Variants§
Spin(Duration)
CPU spin for the given duration.
Sleep(Duration)
Sleep (thread::sleep) for the given duration.
Yield(Duration)
Yield (sched_yield) repeatedly for the given duration.
Io(Duration)
Simulated I/O (write 64 KB to a tempfile + 100 us sleep) for
the given duration. The tempfile lives on whatever filesystem
std::env::temp_dir() returns; on the ktstr guest’s tmpfs the
write is a page-cache memcpy and the sleep provides the
blocking behavior that real disk fsync would cause.
WorkType::IoSyncWrite (the standalone variant) is the disk-IO
counterpart that opens /dev/vda directly.
AluHot
ALU-bound multiply chain for the given duration. The width
selector picks the data path the same way as
WorkType::AluHot — see AluWidth for the resolution
rules and the AVX-512 / AMX caveats. Each visit runs
alu_hot_chain in 1024-step batches in a deadline-bounded
loop so shutdown latency stays bounded by one batch.
The composable counterpart to WorkType::AluHot: use this
inside a Sequence to express duty-cycle
patterns (“ALU 90 % / Sleep 10 %”) that the standalone
WorkType::AluHot cannot, since the standalone variant
runs ALU work for the entire scenario duration.
Implementations§
Source§impl WorkPhase
impl WorkPhase
Sourcepub const fn alu_hot(width: AluWidth, duration: Duration) -> Self
pub const fn alu_hot(width: AluWidth, duration: Duration) -> Self
Construct a WorkPhase::AluHot variant. Sugar for the
struct-literal form that brings the struct variant in line
with the tuple-variant constructors — every other WorkPhase
variant takes a single Duration and reads as
WorkPhase::Spin(d) etc.; the struct variant needs an explicit
WorkPhase::AluHot { width: ..., duration: ... } block at every
call site, breaking the visual symmetry. WorkPhase::alu_hot(w, d)
restores it so vec![WorkPhase::Spin(d1), WorkPhase::alu_hot(w, d2), WorkPhase::Sleep(d3)] reads consistently.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for WorkPhase
impl<'de> Deserialize<'de> for WorkPhase
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>,
impl Eq for WorkPhase
impl StructuralPartialEq for WorkPhase
Auto Trait Implementations§
impl Freeze for WorkPhase
impl RefUnwindSafe for WorkPhase
impl Send for WorkPhase
impl Sync for WorkPhase
impl Unpin for WorkPhase
impl UnwindSafe for WorkPhase
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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