This directory contains performance microbenchmarks for the Python Storage client library.
To run the benchmarks, use pytest with the --benchmark-json flag to specify an output file for the results.
Example:
pytest --benchmark-json=output.json -vv -s tests/perf/microbenchmarks/reads/test_reads.pyTo run a single test, append :: followed by the test name to the file path.
Example:
pytest --benchmark-json=output.json -vv -s tests/perf/microbenchmarks/reads/test_reads.py::test_downloads_single_proc_single_coroThe benchmarks are configured using config.yaml files located in the respective subdirectories (e.g., reads/config.yaml).
You can override the buckets used in the benchmarks by setting environment variables. Please refer to the specific benchmark implementation for the environment variable names.
The benchmarks produce a JSON file with the results. This file can be converted to a CSV file for easier analysis in spreadsheets using the provided json_to_csv.py script.
Example:
python3 tests/perf/microbenchmarks/json_to_csv.py output.json