Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: task 17 panicked #17

Open
dat58 opened this issue Aug 29, 2024 · 1 comment
Open

Error: task 17 panicked #17

dat58 opened this issue Aug 29, 2024 · 1 comment

Comments

@dat58
Copy link

dat58 commented Aug 29, 2024

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.

@wfxr
Copy link
Owner

wfxr commented Dec 25, 2024

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
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants