Skip to content

Commit

Permalink
refactor: Format and fix benchmark scripts and add README
Browse files Browse the repository at this point in the history
  • Loading branch information
raghuvar-vijay committed Apr 12, 2024
1 parent d1a2541 commit f67e803
Show file tree
Hide file tree
Showing 6 changed files with 366 additions and 106 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- [RUSTSEC-2024-0332]: Update h2 from 0.4.2 to 0.4.4 ([@QuantumDancer](https://github.com/QuantumDancer))

### Added
- AUDITOR: Add benchmark to measure db performance (#736) ([@raghuvar-vijay](https://github.com/raghuvar-vijay))
- API: The health check (`GET /health_check`) now fails with an `500 INTERNAL SERVER ERROR` if no connection can be made to the database (#622) ([@QuantumDancer](https://github.com/QuantumDancer))
- CI: Add workflow for testing the pyaudtitor source distribution ([@dirksammel](https://github.com/dirksammel))
- CI: Add workflow for building the Rust documentation ([@dirksammel](https://github.com/dirksammel))
Expand Down
2 changes: 0 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions auditor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,11 @@ once_cell = "1"
claim = { package = "claims", version = "0.7" }
quickcheck = "1"
quickcheck_macros = "1"
<<<<<<< HEAD
tokio = { version = "1", features = ["full"] }
wiremock = "0.6"
criterion = {version = "0.5", features = ["html_reports", "async_tokio"]}
criterion-macro = "0.3"

>>>>>>> 9f3d55c (test: Add benchmark to measure db performance)

[features]
default = ["client", "server"]
client = []
Expand Down
22 changes: 22 additions & 0 deletions auditor/benches/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Benchmarking Auditor Performance

The Auditor benchmark assesses the read performance of the main AUDITOR component, which stores records in POSTGRES. This benchmark evaluates the efficiency of various filters and queries for retrieving record information. Criterion is employed to conduct the benchmarking, and the results are stored in JSON format.

## How to Run the Benchmark

1. Start a new instance of AUDITOR and note the address and port of the AUDITOR client endpoint.
2. Specify the address and port information in `bench.yaml`, located in `auditor/benches/configuration`.
3. Execute the command `cargo bench` from the home directory of AUDITOR.

After completing the benchmark, you can visualize the results in the web version located at `target/criterion/report/index.html`. Alternatively, navigate to a subfolder and open `report/index.html` to view specific query performance results.

### Understanding Benchmarking Process

The benchmarking process involves two main steps:

1. **Inserting Records**: Records are inserted into the database based on the desired size for benchmarking.

2. **Executing Benchmarks**: The `benchmark_with_http_request.rs` file contains the logic for benchmarking. The functions to be benchmarked are specified as parameters to the `criterion_group!` macro call, like so: ```criterion_group!(benches, real_case_record_size_10_000);```


You can modify this call to benchmark different functions as needed.
Loading

0 comments on commit f67e803

Please sign in to comment.