fn fill_relevant(&mut self, relevant: &mut Vec<(u32, ReqGenerator)>) {
        let only_when_running = vec![
            Some((
                self.config.write_unsealed_weight,
                ReqGenerator::WriteUnsealed,
            )),
            Some((self.config.write_sealed_weight, ReqGenerator::WriteSealed))
                .filter(|_| self.state.seal_frontier.iter().any(|(_, ts)| *ts > 0)),
            Some((self.config.write_multi_weight, ReqGenerator::WriteMulti)),
            Some((self.config.read_output_weight, ReqGenerator::ReadOutput)),
            Some((self.config.seal_weight, ReqGenerator::Seal)),
            Some((
                self.config.allow_compaction_weight,
                ReqGenerator::AllowCompaction,
            )),
            Some((self.config.take_snapshot_weight, ReqGenerator::TakeSnapshot)),
            Some((self.config.read_snapshot_weight, ReqGenerator::ReadSnapshot))
                .filter(|_| !self.state.outstanding_snaps.is_empty()),
            Some((self.config.stop_weight, ReqGenerator::Stop)).filter(|_| self.state.running),
            Some((
                self.config.storage_unavailable,
                ReqGenerator::StorageUnavailable,
            ))
            .filter(|_| self.state.storage_available),
        ];
        let also_when_not_running = vec![
            Some((
                self.config.storage_available,
                ReqGenerator::StorageAvailable,
            ))
            .filter(|_| !self.state.storage_available),
            Some((self.config.start_weight, ReqGenerator::Start)).filter(|_| !self.state.running),
        ];

        // Most operations just error if the runtime is down and this is fairly
        // uninteresting to test. Maximize our time spent by focusing on
        // operations that help get the runtime started (Start,
        // StorageAvailable) if it's not.
        if self.state.running {
            relevant.extend(only_when_running.into_iter().flatten());
        }
        relevant.extend(also_when_not_running.into_iter().flatten());
    }
// fill_relevant appends a `(weight, ReqGenerator)` pair for each relevant
// request type.
//
// Examples of when requests are only sometimes relevant:
// - WriteSealed can only apply if at least one stream has been sealed to a
//   timestamp > 0.
// - ReadSnapshot can only apply if we have previously taken a snapshot but
//   not consumed (read) it yet.
fill_relevant appends a `(weight, ReqGenerator)` pair for each relevant
request type.

Examples of when requests are only sometimes relevant:
WriteSealed can only apply if at least one stream has been sealed to a
timestamp > 0.
ReadSnapshot can only apply if we have previously taken a snapshot but
not consumed (read) it yet.
fill_relevant appends a ` ( weight ReqGenerator ) ` pair for each relevant request type . Examples of when requests are only sometimes relevant : WriteSealed can only apply if at least one stream has been sealed to a timestamp > 0 . ReadSnapshot can only apply if we have previously taken a snapshot but not consumed ( read ) it yet .
fn fill_relevant(&mut self, relevant: &mut Vec<(u32, ReqGenerator)>) {
        let only_when_running = vec![
            Some((
                self.config.write_unsealed_weight,
                ReqGenerator::WriteUnsealed,
            )),
            Some((self.config.write_sealed_weight, ReqGenerator::WriteSealed))
                .filter(|_| self.state.seal_frontier.iter().any(|(_, ts)| *ts > 0)),
            Some((self.config.write_multi_weight, ReqGenerator::WriteMulti)),
            Some((self.config.read_output_weight, ReqGenerator::ReadOutput)),
            Some((self.config.seal_weight, ReqGenerator::Seal)),
            Some((
                self.config.allow_compaction_weight,
                ReqGenerator::AllowCompaction,
            )),
            Some((self.config.take_snapshot_weight, ReqGenerator::TakeSnapshot)),
            Some((self.config.read_snapshot_weight, ReqGenerator::ReadSnapshot))
                .filter(|_| !self.state.outstanding_snaps.is_empty()),
            Some((self.config.stop_weight, ReqGenerator::Stop)).filter(|_| self.state.running),
            Some((
                self.config.storage_unavailable,
                ReqGenerator::StorageUnavailable,
            ))
            .filter(|_| self.state.storage_available),
        ];
        let also_when_not_running = vec![
            Some((
                self.config.storage_available,
                ReqGenerator::StorageAvailable,
            ))
            .filter(|_| !self.state.storage_available),
            Some((self.config.start_weight, ReqGenerator::Start)).filter(|_| !self.state.running),
        ];
        // Most operations just error if the runtime is down and this is fairly
        // uninteresting to test. Maximize our time spent by focusing on
        // operations that help get the runtime started (Start,
        // StorageAvailable) if it's not.
        if self.state.running {
            relevant.extend(only_when_running.into_iter().flatten());
        }
        relevant.extend(also_when_not_running.into_iter().flatten());
    }
fn fill_relevant ( & mut self , relevant : & mut Vec < ( u32 , ReqGenerator ) > ) { let only_when_running = vec ! [ Some ( ( self config write_unsealed_weight ReqGenerator WriteUnsealed ) ) Some ( ( self config write_sealed_weight ReqGenerator WriteSealed ) ) filter ( self state seal_frontier iter ( ) any ( ( ts ) ts 0 ) ) Some ( ( self config write_multi_weight ReqGenerator WriteMulti ) ) Some ( ( self config read_output_weight ReqGenerator ReadOutput ) ) Some ( ( self config seal_weight ReqGenerator Seal ) ) Some ( ( self config allow_compaction_weight ReqGenerator AllowCompaction ) ) Some ( ( self config take_snapshot_weight ReqGenerator TakeSnapshot ) ) Some ( ( self config read_snapshot_weight ReqGenerator ReadSnapshot ) ) filter ( self state outstanding_snaps is_empty ( ) ) Some ( ( self config stop_weight ReqGenerator Stop ) ) filter ( self state running ) Some ( ( self config storage_unavailable ReqGenerator StorageUnavailable ) ) filter ( self state storage_available ) ] ; let also_when_not_running = vec ! [ Some ( ( self config storage_available ReqGenerator StorageAvailable ) ) filter ( self state storage_available ) Some ( ( self config start_weight ReqGenerator Start ) ) filter ( self state running ) ] ; // Most operations just error if the runtime is down and this is fairly // uninteresting to test. Maximize our time spent by focusing on // operations that help get the runtime started (Start, // StorageAvailable) if it's not. if self . state . running { relevant . extend ( only_when_running . into_iter ( ) . flatten ( ) ) ; } relevant . extend ( also_when_not_running . into_iter ( ) . flatten ( ) ) ; }
fill_relevant appends a `(weight, ReqGenerator)` pair for each relevant
request type.
fill_relevant appends a ` ( weight ReqGenerator ) ` pair for each relevant request type .
&mut self
relevant
&mut Vec<(u32, ReqGenerator)>
&mut self
relevant
&mut Vec<(u32, ReqGenerator)>