pub struct PhaseDisplayOptions {
pub no_phases: bool,
pub phases_only: bool,
pub steps_only: bool,
pub phase: Option<u16>,
pub phase_threshold: Option<f64>,
}Expand description
Re-export of the comparison-policy types so downstream crates
using ktstr::cli as their public surface don’t need to reach
into the internal ktstr::stats module (which is pub(crate) —
see lib.rs — and therefore not a stable public path). The
policy is the only item in stats that a CLI or external
consumer constructs directly; every other item is internal
plumbing reached via cli::compare_partitions.
CLI-controlled rendering of the per-phase spread block in
cargo ktstr perf-delta --noise-adjust. Bundled as a struct
so the 5-flag clap surface threads through
compare_partitions_noise as a single positional rather than
five. Default value renders every phase / every metric / every
paired row — equivalent to passing no phase flags. All 5 flags
require --noise-adjust (per-phase output exists only there).
The flags compose via AND on independent axes (block-level suppression × phase-id × row-significance), with three mutex constraints enforced at CLI parse time:
--no-phasesexcludes every other phase flag (the whole block is suppressed; refining what to render is a contradiction).--phases-onlyexcludes--no-phases(same reason).--steps-onlyexcludes--phase(one of them collapses to a single bucket; the other suppresses BASELINE — both together are confused phrasing).
The 5 flags trigger renderer behaviour ONLY — the
--noise-adjust per-phase pass always computes the full set
of NoisePhaseFindings and coverage entries so programmatic
consumers see the unfiltered surface. Filtering is render-time
projection.
Fields§
§no_phases: bool--no-phases: suppress the --noise-adjust per-phase
spread block entirely. The aggregate spread table and
footer render unchanged; the only effect is hiding the
per-phase block (and its footer hint). Mutually exclusive
with every other phase flag at CLI parse time.
phases_only: bool--phases-only: suppress the aggregate spread table and
the host-context delta; render ONLY the per-phase spread
block. Useful for narrowing investigation to a phase
regression when the aggregate rollup is noise. Composes
with --steps-only, --phase, and --phase-threshold.
steps_only: bool--steps-only: within the per-phase block, suppress
the BASELINE bucket (step_index == 0); render only
scenario Step buckets. Useful when the BASELINE settle
window is dominated by scheduler startup transients.
Mutually exclusive with --phase.
phase: Option<u16>--phase <N>: within the per-phase block, render only
rows whose step_index == N. 0 selects BASELINE;
1..=N selects scenario Step ordinals (1 → Step[0],
2 → Step[1], …). Integer chosen over label so a label
rename ("Step[0]" → "Step:0") doesn’t break operator
CI invocations. Mutually exclusive with --steps-only.
phase_threshold: Option<f64>--phase-threshold <PCT>: render-side relative-spread
gate for the --noise-adjust per-phase pass. Suppresses
paired rows where |delta-mean| / |a.mean| < PCT / 100.0;
a value from a ~zero baseline (|a.mean| < ZERO_MEAN_EPS)
is an unbounded relative change and clears any finite
threshold. 0.0 shows every paired row; absence falls
through to the registry’s per-metric default_rel.
Independent from --threshold — the aggregate and
per-phase passes have separate filters so an operator can
widen the per-phase view without widening the aggregate
view.
Implementations§
Source§impl PhaseDisplayOptions
impl PhaseDisplayOptions
Sourcepub fn rel_threshold(
&self,
policy: &ComparisonPolicy,
metric_name: &str,
default_rel: f64,
) -> f64
pub fn rel_threshold( &self, policy: &ComparisonPolicy, metric_name: &str, default_rel: f64, ) -> f64
Resolve the per-phase relative threshold for a given
metric. Returns the override fraction when
phase_threshold is set, else falls through to the
ComparisonPolicy resolution the scalar pass uses. The
metric_name + default_rel shape mirrors
ComparisonPolicy::rel_threshold so the two surfaces
stay symmetric.
Sourcepub fn matches_phase(&self, step_index: u16) -> bool
pub fn matches_phase(&self, step_index: u16) -> bool
True when a phase row at the given step_index should
render under the current display flags. Combines the two
step-axis predicates (--phase <N> filter and
--steps-only BASELINE-suppressor) into a single
row-level decision the renderer applies uniformly across
the --noise-adjust per-phase findings and coverage rows.
Returns true when no relevant flag is set (default
path: every step renders).
Trait Implementations§
Source§impl Clone for PhaseDisplayOptions
impl Clone for PhaseDisplayOptions
Source§fn clone(&self) -> PhaseDisplayOptions
fn clone(&self) -> PhaseDisplayOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PhaseDisplayOptions
impl Debug for PhaseDisplayOptions
Source§impl Default for PhaseDisplayOptions
impl Default for PhaseDisplayOptions
Source§fn default() -> PhaseDisplayOptions
fn default() -> PhaseDisplayOptions
Auto Trait Implementations§
impl Freeze for PhaseDisplayOptions
impl RefUnwindSafe for PhaseDisplayOptions
impl Send for PhaseDisplayOptions
impl Sync for PhaseDisplayOptions
impl Unpin for PhaseDisplayOptions
impl UnwindSafe for PhaseDisplayOptions
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<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