0
0
mirror of https://github.com/PostHog/posthog.git synced 2024-12-01 12:21:02 +01:00
posthog/ee/benchmarks
Eric Duong 46faa8fab2
refactor(FOSS): foss remove all ee dependencies from /posthog (#10319)
* refactor: foss move properties to /posthog

* refactor: move replication and materializtaion

* refactor: move file

* refactor: move test and journeys

* refactor: move breakdown props

* refactor: move query imports

* refactor: move more ee dependencies

* refactor: restore groupsjoinquery

* fix: errors

* refactor: no ee.clickhouse dependncies

* try import tasks

* refactor: move materialization

* refactor: change foss split for column optimizer

* run black

* fix: imports

* remove comment

* Update snapshots

* run black

* skip isort

* Update snapshots

* format

* more fixes

* refactor(FOSS): split out paths query code (#10378)

* refactor: move migrations

* refactor: move idl

* fix: move more imports

* import adjustments

* fix: test import

* fix: test import

* fix: remove restriction

* refactor: split out paths query code

* refactor: more code splitting

* fix: types

* refactor(FOSS): Setup such that FOSS is deployable (#10352)

* refactor: move migrations

* refactor: move idl

* fix: move more imports

* import adjustments

* fix: test import

* fix: test import

* fix: remove restriction

* fix import

* refactor: add snapshost

* subscription-import

* fix: safe import

Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
2022-06-22 17:24:03 -04:00
..
__init__.py flake8: enable E266,W291,W293,W391,W601 (#8699) 2022-02-21 15:47:27 +01:00
asv.conf.json
benchmarks.py refactor(FOSS): foss remove all ee dependencies from /posthog (#10319) 2022-06-22 17:24:03 -04:00
helpers.py refactor: move event and person query to /posthog (#8970) 2022-03-22 20:27:11 +00:00
measure.sh Add measure.sh helper script to repo (#7877) 2022-01-05 12:46:08 +02:00
README.md perf(lifecycle): add benchmark for lifecycle (#7753) 2021-12-17 09:36:49 +00:00

Clickhouse query benchmarks

This is the benchmark suite for PostHog clickhouse queries. It tracks performance improvements to clickhouse queries over time.

The benchmarks are run using airspeed velocity.

To get stable results over time, a stable clickhouse node which has been pre-filled with data is used to run against.

Historical benchmark results can be found in https://github.com/PostHog/benchmark-results.

FAQ

Benchmarking your PRs

Benchmarks run every day against master branch.

If your branch contains significant changes to query performance, add performance label to your PR.

An action will then run and comment on the benchmarks on your PR.

Installation (local)

These benchmarks are run using airspeed velocity so, you need to have asv installed which in turn needs virtualenv (or an anaconda dist),

pip install asv virtualenv

Running the benchmarks locally

These benchmarks are mostly run in CI for:

  • master branch
  • PRs labeled with performance

To run the all the benchmarks locally, get access to the clickhouse node and:

# 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

You'll probably want to be running one test, with quick iteration. Running e.g.:

asv run --config ee/benchmarks/asv.conf.json --bench track_lifecycle --quick

will run any benchmark regex-matching track_lifecycle only once.

See asv documentation 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.