pub fn launch_workloads(
    workloads: Vec<cfgtypes::BenchmarkWorkload>,
    work_queue: &[Queue<Vec<u8>>],
    stats: &Sender<Stat>,
    clocksource: &Clocksource,
) {
    for (i, w) in workloads.into_iter().enumerate() {
        info!(
            "Workload {}: Method: {} Rate: {}",
            i,
            w.gen.method(),
            w.rate
        );

        let mut workload = Workload::new(
            w.gen,
            Some(w.rate as u64),
            work_queue.to_vec(),
            stats.clone(),
            clocksource.clone(),
        ).unwrap();

        let _ = thread::Builder::new()
            .name(format!("workload{}", i).to_string())
            .spawn(move || loop {
                workload.run();
            });
    }
}
/// Launch each of the workloads in their own thread
Launch each of the workloads in their own thread
Launch each of the workloads in their own thread
pub fn launch_workloads(
    workloads: Vec<cfgtypes::BenchmarkWorkload>,
    work_queue: &[Queue<Vec<u8>>],
    stats: &Sender<Stat>,
    clocksource: &Clocksource,
) {
    for (i, w) in workloads.into_iter().enumerate() {
        info!(
            "Workload {}: Method: {} Rate: {}",
            i,
            w.gen.method(),
            w.rate
        );
        let mut workload = Workload::new(
            w.gen,
            Some(w.rate as u64),
            work_queue.to_vec(),
            stats.clone(),
            clocksource.clone(),
        ).unwrap();
        let _ = thread::Builder::new()
            .name(format!("workload{}", i).to_string())
            .spawn(move || loop {
                workload.run();
            });
    }
}
pub fn launch_workloads ( workloads : Vec < cfgtypes :: BenchmarkWorkload > , work_queue : & [ Queue < Vec < u8 > > ] , stats : & Sender < Stat > , clocksource : & Clocksource , ) { for ( i , w ) in workloads . into_iter ( ) . enumerate ( ) { info ! ( " " i w gen method ( ) w rate ) ; let mut workload = Workload :: new ( w . gen , Some ( w . rate as u64 ) , work_queue . to_vec ( ) , stats . clone ( ) , clocksource . clone ( ) , ) . unwrap ( ) ; let _ = thread :: Builder :: new ( ) . name ( format ! ( " " i ) . to_string ( ) ) . spawn ( move | | loop { workload . run ( ) ; } ) ; } }
Launch each of the workloads in their own thread
Launch each of the workloads in their own thread
workloads
Vec<cfgtypes::BenchmarkWorkload>
work_queue
&[Queue<Vec<u8>>]
stats
&Sender<Stat>
clocksource
&Clocksource
workloads
Vec<cfgtypes::BenchmarkWorkload>
work_queue
&[Queue<Vec<u8>>]
stats
&Sender<Stat>
clocksource
&Clocksource