Skip to content

Commit

Permalink
Add more queries
Browse files Browse the repository at this point in the history
  • Loading branch information
spennihana committed Mar 6, 2014
1 parent d259e88 commit 2fdf4e9
Show file tree
Hide file tree
Showing 3 changed files with 108 additions and 0 deletions.
40 changes: 40 additions & 0 deletions h2o-perf/queries/best_results
Original file line number Diff line number Diff line change
@@ -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;
24 changes: 24 additions & 0 deletions h2o-perf/queries/historical_results
Original file line number Diff line number Diff line change
@@ -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;
44 changes: 44 additions & 0 deletions h2o-perf/queries/last_n_builds
Original file line number Diff line number Diff line change
@@ -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 ;

0 comments on commit 2fdf4e9

Please sign in to comment.