From 2fdf4e94cfc552ee491704138b66621400189187 Mon Sep 17 00:00:00 2001 From: SpencerA Date: Wed, 5 Mar 2014 21:07:20 -0800 Subject: [PATCH] Add more queries --- h2o-perf/queries/best_results | 40 ++++++++++++++++++++++++++ h2o-perf/queries/historical_results | 24 ++++++++++++++++ h2o-perf/queries/last_n_builds | 44 +++++++++++++++++++++++++++++ 3 files changed, 108 insertions(+) create mode 100644 h2o-perf/queries/best_results create mode 100644 h2o-perf/queries/historical_results create mode 100644 h2o-perf/queries/last_n_builds diff --git a/h2o-perf/queries/best_results b/h2o-perf/queries/best_results new file mode 100644 index 0000000000..c1c9c5d0b5 --- /dev/null +++ b/h2o-perf/queries/best_results @@ -0,0 +1,40 @@ +SELECT + date, + h2o_build_name, + h2o_version, + dataset, + total_hosts, + elapsed_time, + -- Hack to do the same thing as row_number() over partition by from tsql -- + IF (@prevGroup <> product, @curRank := 1, @curRank := @curRank + 1) AS rank, + @prevGroup := product as product +FROM ( + SELECT + -- Select from test_run -- + FROM_UNIXTIME(test_run.start_epoch_ms, "%Y-%m-%d") AS date, + test_run.product_name AS product, + test_run.build_branch AS h2o_build_name, + test_run.build_version AS h2o_version, + test_run.dataset_name AS dataset, + test_run.total_hosts AS total_hosts, + -- Select from test_run_phase_result -- + test_run_phase_result.start_epoch_ms AS start_time, + test_run_phase_result.end_epoch_ms AS end_time, + test_run_phase_result.end_epoch_ms - test_run_phase_result.start_epoch_ms AS elapsed_time + FROM + test_run + INNER JOIN + test_run_phase_result + ON + test_run.test_run_id = test_run_phase_result.test_run_id + WHERE + test_run_phase_result.phase_name = '%PHASE_NAME%' #Default is model building phase + AND test_run.test_name = '%TEST_NAME%' + AND test_run.total_hosts = '%NUM_HOSTS%' + ORDER BY + product, date) p, (SELECT @curRank := 0) r, (SELECT @prevGroup := null) g +WHERE + -- select top performing run from each product -- + rank = 1 +ORDER BY + elapsed_time; diff --git a/h2o-perf/queries/historical_results b/h2o-perf/queries/historical_results new file mode 100644 index 0000000000..1eecb47577 --- /dev/null +++ b/h2o-perf/queries/historical_results @@ -0,0 +1,24 @@ +SELECT + -- Select from test_run -- + FROM_UNIXTIME(test_run.start_epoch_ms, "%Y-%m-%d") AS date, + test_run.product_name AS product, + test_run.build_branch AS h2o_build_name, + test_run.build_version AS h2o_version, + test_run.dataset_name AS dataset, + test_run.total_hosts AS total_hosts, + -- Select from test_run_phase_result -- + test_run_phase_result.start_epoch_ms AS start_time, + test_run_phase_result.end_epoch_ms AS end_time, + test_run_phase_result.end_epoch_ms - test_run_phase_result.start_epoch_ms AS elapsed_time +FROM + test_run +INNER JOIN + test_run_phase_result +ON + test_run.test_run_id = test_run_phase_result.test_run_id +WHERE + test_run_phase_result.phase_name = '%PHASE_NAME%' #Default is model building phase + AND test_run.test_name = '%TEST_NAME%' + AND test_run.total_hosts = '%NUM_HOSTS%' +ORDER BY + product, date; diff --git a/h2o-perf/queries/last_n_builds b/h2o-perf/queries/last_n_builds new file mode 100644 index 0000000000..4be38c611d --- /dev/null +++ b/h2o-perf/queries/last_n_builds @@ -0,0 +1,44 @@ +DELIMITER $$ + +CREATE DEFINER=`spencer`@`localhost` PROCEDURE `LastN` (IN testName longtext, IN numBuilds bigint(20), IN phasse longtext) +BEGIN + SELECT + -- Select from test_run -- + test_run.test_name AS "test name", + FROM_UNIXTIME(test_run.start_epoch_ms/1000, "%Y-%m-%d") as run_date, + test_run.build_version as version, + test_run.build_branch as branch, + test_run.build_date as build_date, + test_run.build_sha as "build sha", + test_run.cpus_per_host as "CPUs/Host", + test_run.total_hosts as "Number of hosts", + test_run.start_epoch_ms as "test_start_time(ms from epoch)", + test_run.end_epoch_ms as "test_end_time(ms from epoch)", + (test_run.end_epoch_ms - test_run.start_epoch_ms)/1000 AS "test_run_elapsed(s)", + test_run.heap_bytes_per_node as "Heap Bytes Per Node", + test_run.dataset_name AS "Dataset", + test_run.passed AS "overall test passed", + test_run.correctness_passed AS "overall correctness passed", + test_run.contaminated AS "Test contaminated", + + -- Select from test phase result -- + test_run_phase_result.phase_name AS "phase", + test_run_phase_result.start_epoch_ms AS "phase_start_time(ms from epoch)", + test_run_phase_result.end_epoch_ms AS "phase_end_time(ms from epoch)", + (test_run_phase_result.end_epoch_ms - test_run_phase_result.start_epoch_ms)/1000 AS "phase_elapsed_time(s)", + test_run_phase_result.passed AS "phase test passed", + test_run_phase_result.correctness_passed AS "phase correctness passed" + FROM + test_run + INNER JOIN + test_run_phase_result + ON + test_run.test_run_id = test_run_phase_result.test_run_id + WHERE + test_run_phase_result.phase_name = phasse #Default is model building phase + AND test_run.test_name = testName + ORDER BY + branch, build_date, run_date + LIMIT numBuilds; +END$$ +DELIMITER ;