rlt icon indicating copy to clipboard operation
rlt copied to clipboard

Error: task 17 panicked

Open dat58 opened this issue 1 year ago • 1 comments

I have used version 0.2.0, and I just tested the library to ensure it works correctly. Therefore, I have written a simple benchmark like:

async fn bench(
        &mut self,
        _: &mut Self::WorkerState,
        _: &IterInfo,
    ) -> Result<IterReport> {
        Ok(IterReport {
            duration: std::time::Duration::from_secs(1),
            status: Status::success(0),
            bytes: 0,
            items: 1,
        })
    }
cargo run -- -c 1 -n 1 --fps 1

However, I encountered the error I mentioned above.

dat58 avatar Aug 29 '24 07:08 dat58

Hi @dat58, thanks for your report, and sorry for the very late reply. I tried the snippet you described and cannot reproduce the error. Would be appreciated if you could provide the complete code.

$ cargo r --example=simple_stateless -- -c 1 -n 1 --fps 1
   Compiling rlt v0.2.0 (/home/wenxuan/dev/rlt)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.06s
     Running `target/debug/examples/simple_stateless -c 1 -n 1 --fps 1`
Summary
  Benchmark took 0.00s with concurrency 1 (100.00% success)

           Total      Rate
  Iters        1    1320.08/s
  Items        1    1320.08/s
  Bytes      0 B        0 B/s

Latencies
  Stats
     Avg      Min      Med      Max     Stdev
    1.00s    1.00s    1.00s    1.00s    0.00s

  Percentiles
    10.00% in 1.00s
    25.00% in 1.00s
    50.00% in 1.00s
    75.00% in 1.00s
    90.00% in 1.00s
    95.00% in 1.00s
    99.00% in 1.00s
    99.90% in 1.00s
    99.99% in 1.00s

  Histogram
    [1] 1.00s 🭵■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■

Status distribution
  [1] Success(0)

Whole content of examples/simple_stateless.rs:

use anyhow::Result;
use async_trait::async_trait;
use clap::Parser;
use rlt::{
    cli::BenchCli,
    IterReport, Status, {IterInfo, StatelessBenchSuite},
};

#[derive(Clone)]
struct SimpleBench;

#[async_trait]
impl StatelessBenchSuite for SimpleBench {
    async fn bench(&mut self, _info: &IterInfo) -> Result<IterReport> {
        Ok(IterReport {
            duration: std::time::Duration::from_secs(1),
            status: Status::success(0),
            bytes: 0,
            items: 1,
        })
    }
}

#[tokio::main]
async fn main() -> Result<()> {
    rlt::cli::run(BenchCli::parse(), SimpleBench).await
}

wfxr avatar Dec 25 '24 15:12 wfxr