To run the all the benchmarks locally, [get access to the clickhouse node](https://github.com/PostHog/vpc/blob/main/client_values/benchmarking/values.yaml) and:
```bash
# Set up machine
asv machine --machine ci-benchmarks --config ee/benchmarks/asv.conf.json
# Replace X with appropriate credentials
CLICKHOUSE_HOST=X CLICKHOUSE_USER=X CLICKHOUSE_PASSWORD=X CLICKHOUSE_DATABASE=posthog asv run --config ee/benchmarks/asv.conf.json
See [asv documentation](https://asv.readthedocs.io/en/stable/commands.html#asv-run) for additional information.
## Adding new benchmarks
Edit the `benchmarks.py` file as needed. Use `@benchmark_clickhouse` decorator to select tests to run
## Backfilling benchmarks
- Clone `https://github.com/PostHog/benchmark-results` locally under ee/benchmarks/results
- Run something like `CLICKHOUSE_HOST=X CLICKHOUSE_USER=X CLICKHOUSE_PASSWORD=X CLICKHOUSE_DATABASE=posthog asv run --config ee/benchmarks/asv.conf.json --date-period 4d master~500..`
- Run `asv publish` and commit the changes to benchmark-results repo
If you have questions, use benchmark.yml github action as a guide.