-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
13 changed files
with
590 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## Schema | ||
|
||
See [schema.sql](schema.sql) for the example schema. | ||
|
||
## Usage | ||
|
||
Define PostgreSQL connection details via environment variables: | ||
|
||
```bash | ||
export POSTGRES_HOSTNAME=... | ||
export POSTGRES_USERNAME=... | ||
export POSTGRES_PASSWORD=... | ||
export POSTGRES_DATABASE=... | ||
``` | ||
|
||
or in `hunter.yaml`. | ||
|
||
The following command shows results for a single test `aggregate_mem` and updates the database with newly found change points: | ||
|
||
```bash | ||
$ BRANCH=trunk HUNTER_CONFIG=hunter.yaml hunter analyze aggregate_mem --update-postgres | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# External systems connectors configuration: | ||
postgres: | ||
hostname: ${POSTGRES_HOSTNAME} | ||
port: ${POSTGRES_PORT} | ||
username: ${POSTGRES_USERNAME} | ||
password: ${POSTGRES_PASSWORD} | ||
database: ${POSTGRES_DATABASE} | ||
|
||
# Templates define common bits shared between test definitions: | ||
templates: | ||
common: | ||
type: postgres | ||
time_column: commit_ts | ||
attributes: [experiment_id, config_id, commit] | ||
# required for --update-postgres to work | ||
update_statement: | | ||
UPDATE results | ||
SET {metric}_rel_forward_change=%s, | ||
{metric}_rel_backward_change=%s, | ||
{metric}_p_value=%s | ||
WHERE experiment_id = '{experiment_id}' AND config_id = {config_id} | ||
metrics: | ||
process_cumulative_rate_mean: | ||
direction: 1 | ||
scale: 1 | ||
process_cumulative_rate_stderr: | ||
direction: -1 | ||
scale: 1 | ||
process_cumulative_rate_diff: | ||
direction: -1 | ||
scale: 1 | ||
|
||
# Define your tests here: | ||
tests: | ||
aggregate_mem: | ||
inherit: [ common ] # avoids repeating metrics definitions and postgres-related config | ||
query: | | ||
SELECT e.commit, | ||
e.commit_ts, | ||
r.process_cumulative_rate_mean, | ||
r.process_cumulative_rate_stderr, | ||
r.process_cumulative_rate_diff, | ||
r.experiment_id, | ||
r.config_id | ||
FROM results r | ||
INNER JOIN configs c ON r.config_id = c.id | ||
INNER JOIN experiments e ON r.experiment_id = e.id | ||
WHERE e.exclude_from_analysis = false AND | ||
e.branch = '${BRANCH}' AND | ||
e.username = 'ci' AND | ||
c.store = 'MEM' AND | ||
c.cache = true AND | ||
c.benchmark = 'aggregate' AND | ||
c.instance_type = 'ec2i3.large' | ||
ORDER BY e.commit_ts ASC; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
CREATE TABLE IF NOT EXISTS configs ( | ||
id SERIAL PRIMARY KEY, | ||
benchmark TEXT NOT NULL, | ||
scenario TEXT NOT NULL, | ||
store TEXT NOT NULL, | ||
instance_type TEXT NOT NULL, | ||
cache BOOLEAN NOT NULL, | ||
UNIQUE(benchmark, | ||
scenario, | ||
store, | ||
cache, | ||
instance_type) | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS experiments ( | ||
id TEXT PRIMARY KEY, | ||
ts TIMESTAMPTZ NOT NULL, | ||
branch TEXT NOT NULL, | ||
commit TEXT NOT NULL, | ||
commit_ts TIMESTAMPTZ NOT NULL, | ||
username TEXT NOT NULL, | ||
details_url TEXT NOT NULL, | ||
exclude_from_analysis BOOLEAN DEFAULT false NOT NULL, | ||
exclude_reason TEXT | ||
); | ||
|
||
CREATE TABLE IF NOT EXISTS results ( | ||
experiment_id TEXT NOT NULL REFERENCES experiments(id), | ||
config_id INTEGER NOT NULL REFERENCES configs(id), | ||
|
||
process_cumulative_rate_mean BIGINT NOT NULL, | ||
process_cumulative_rate_stderr BIGINT NOT NULL, | ||
process_cumulative_rate_diff BIGINT NOT NULL, | ||
|
||
process_cumulative_rate_mean_rel_forward_change DOUBLE PRECISION, | ||
process_cumulative_rate_mean_rel_backward_change DOUBLE PRECISION, | ||
process_cumulative_rate_mean_p_value DECIMAL, | ||
|
||
process_cumulative_rate_stderr_rel_forward_change DOUBLE PRECISION, | ||
process_cumulative_rate_stderr_rel_backward_change DOUBLE PRECISION, | ||
process_cumulative_rate_stderr_p_value DECIMAL, | ||
|
||
process_cumulative_rate_diff_rel_forward_change DOUBLE PRECISION, | ||
process_cumulative_rate_diff_rel_backward_change DOUBLE PRECISION, | ||
process_cumulative_rate_diff_p_value DECIMAL, | ||
|
||
PRIMARY KEY (experiment_id, config_id) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.