Skip to content

configurable latency percentiles #13

@GabrielTecuceanu

Description

@GabrielTecuceanu

Latency percentiles are currently hardcoded. Users running SLO-sensitive benchmarks may need p99.9 or custom percentiles.

What to add:
cli:

httpress -n 10000 https://example.com --percentiles 50,90,99,99.9

library:

Benchmark::builder()
    .url("https://example.com")
    .percentiles(vec![50.0, 90.0, 99.0, 99.9])
    .build()?
    .run()
    .await?;

Relevant files:

  • src/cli.rs - add flag
  • src/config.rs - add --percentiles field with default of [50.0, 90.0, 95.0, 99.0]
  • src/benchmark.rs - add .percentiles() builder method
  • src/metrics.rs- make percentile computation dynamic
  • src/main.rs - update display

notes:

  • make sure to also update the readme cli useage / options section to include the new flag
  • also add a documentation comment to .percentiles() builder method with a description and a minimal example (you can look at the other functions for reference).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions