diff options
author | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-09-19 00:48:59 +0000 |
---|---|---|
committer | showard <showard@592f7852-d20e-0410-864c-8624ca9c26a4> | 2008-09-19 00:48:59 +0000 |
commit | cac336495171c7492586f53950405e498066b048 (patch) | |
tree | 374ed145cbb7855c3746ce024e27e88f59638056 /tko/migrations | |
parent | b3c0293711074a256bedc6d433c5a01e2c5926e4 (diff) |
Attached is a large patch for a powerful and flexible new graphing system for new TKO. This system subsumes all the previous kernel graphing scripts under the tko/ directory and is capable of much more. These wiki pages document usage of the new system and give an idea of what it's capable of:
http://autotest.kernel.org/wiki/MetricsPlot
http://autotest.kernel.org/wiki/MachineQualHistograms
Feel free to try it out and please let us know if you run into any trouble.
This system is the work of our summer intern James Ren. Thank you for all your fantastic work, James!
From: James Ren <jamesren@stanford.edu>
git-svn-id: svn://test.kernel.org/autotest/trunk@2171 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/migrations')
-rw-r--r-- | tko/migrations/015_support_graphing_interface.py | 101 | ||||
-rw-r--r-- | tko/migrations/016_modify_perf_view_2.py | 45 | ||||
-rw-r--r-- | tko/migrations/017_add_embedded_graph_caching.py | 33 |
3 files changed, 179 insertions, 0 deletions
diff --git a/tko/migrations/015_support_graphing_interface.py b/tko/migrations/015_support_graphing_interface.py new file mode 100644 index 00000000..402a7e43 --- /dev/null +++ b/tko/migrations/015_support_graphing_interface.py @@ -0,0 +1,101 @@ +def migrate_up(manager): + manager.execute(CREATE_QUERIES_TABLE) + manager.execute(CREATE_TEST_VIEW_OUTER_JOINS) + manager.execute(CREATE_PERF_VIEW_2) + +def migrate_down(manager): + manager.execute(DROP_QUERIES_TABLE) + manager.execute(DROP_TEST_VIEW_OUTER_JOINS) + manager.execute(DROP_PERF_VIEW_2) + + +CREATE_QUERIES_TABLE = """\ +CREATE TABLE embedded_graphing_queries ( + id INT NOT NULL AUTO_INCREMENT, + url_token TEXT NOT NULL, + graph_type VARCHAR(16) NOT NULL, + params TEXT NOT NULL, + last_accessed DATETIME NOT NULL, + PRIMARY KEY(id), + INDEX (url_token(128))) +""" + +DROP_QUERIES_TABLE = """\ +DROP TABLE IF EXISTS embedded_graphing_queries +""" + +CREATE_TEST_VIEW_OUTER_JOINS = """\ +CREATE VIEW test_view_outer_joins AS +SELECT tests.test_idx, + tests.job_idx, + tests.test AS test_name, + tests.subdir, + tests.kernel_idx, + tests.status AS status_idx, + tests.reason, + tests.machine_idx, + tests.started_time AS test_started_time, + tests.finished_time AS test_finished_time, + jobs.tag AS job_tag, + jobs.label AS job_name, + jobs.username AS job_owner, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS hostname, + machines.machine_group AS platform, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel, + status.word AS status +FROM tests +LEFT OUTER JOIN jobs ON jobs.job_idx = tests.job_idx +LEFT OUTER JOIN machines ON machines.machine_idx = jobs.machine_idx +LEFT OUTER JOIN kernels ON kernels.kernel_idx = tests.kernel_idx +LEFT OUTER JOIN status ON status.status_idx = tests.status; +""" + +DROP_TEST_VIEW_OUTER_JOINS = """\ +DROP VIEW IF EXISTS test_view_outer_joins +""" + +CREATE_PERF_VIEW_2 = """\ +CREATE VIEW perf_view_2 AS +SELECT tests.test_idx, + tests.job_idx, + tests.test AS test_name, + tests.subdir, + tests.kernel_idx, + tests.status AS status_idx, + tests.reason, + tests.machine_idx, + tests.started_time AS test_started_time, + tests.finished_time AS test_finished_time, + jobs.tag AS job_tag, + jobs.label AS job_name, + jobs.username AS job_owner, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS hostname, + machines.machine_group AS platform, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel, + status.word AS status, + iteration_result.iteration, + iteration_result.attribute AS iteration_key, + iteration_result.value AS iteration_value +FROM tests +INNER JOIN jobs ON jobs.job_idx = tests.job_idx +INNER JOIN machines ON machines.machine_idx = jobs.machine_idx +INNER JOIN kernels ON kernels.kernel_idx = tests.kernel_idx +INNER JOIN status ON status.status_idx = tests.status +INNER JOIN iteration_result ON iteration_result.test_idx = tests.test_idx; +""" + +DROP_PERF_VIEW_2 = """\ +DROP VIEW IF EXISTS perf_view_2 +""" diff --git a/tko/migrations/016_modify_perf_view_2.py b/tko/migrations/016_modify_perf_view_2.py new file mode 100644 index 00000000..f94df0f4 --- /dev/null +++ b/tko/migrations/016_modify_perf_view_2.py @@ -0,0 +1,45 @@ +prev_migration = __import__('015_support_graphing_interface') + +def migrate_up(manager): + manager.execute(prev_migration.DROP_PERF_VIEW_2) + manager.execute(CREATE_NEW_PERF_VIEW_2) + +def migrate_down(manager): + manager.execute(prev_migration.DROP_PERF_VIEW_2) + manager.execute(prev_migration.CREATE_PERF_VIEW_2) + +CREATE_NEW_PERF_VIEW_2 = """\ +CREATE VIEW perf_view_2 AS +SELECT tests.test_idx, + tests.job_idx, + tests.test AS test_name, + tests.subdir, + tests.kernel_idx, + tests.status AS status_idx, + tests.reason, + tests.machine_idx, + tests.started_time AS test_started_time, + tests.finished_time AS test_finished_time, + jobs.tag AS job_tag, + jobs.label AS job_name, + jobs.username AS job_owner, + jobs.queued_time AS job_queued_time, + jobs.started_time AS job_started_time, + jobs.finished_time AS job_finished_time, + machines.hostname AS hostname, + machines.machine_group AS platform, + machines.owner AS machine_owner, + kernels.kernel_hash, + kernels.base AS kernel_base, + kernels.printable AS kernel, + status.word AS status, + iteration_result.iteration, + iteration_result.attribute AS iteration_key, + iteration_result.value AS iteration_value +FROM tests +LEFT OUTER JOIN jobs ON jobs.job_idx = tests.job_idx +LEFT OUTER JOIN machines ON machines.machine_idx = jobs.machine_idx +LEFT OUTER JOIN kernels ON kernels.kernel_idx = tests.kernel_idx +LEFT OUTER JOIN status ON status.status_idx = tests.status +LEFT OUTER JOIN iteration_result ON iteration_result.test_idx = tests.test_idx; +""" diff --git a/tko/migrations/017_add_embedded_graph_caching.py b/tko/migrations/017_add_embedded_graph_caching.py new file mode 100644 index 00000000..bee74717 --- /dev/null +++ b/tko/migrations/017_add_embedded_graph_caching.py @@ -0,0 +1,33 @@ +def migrate_up(manager): + manager.execute_script(ADD_COLUMNS) + +def migrate_down(manager): + manager.execute_script(DROP_COLUMNS) + +ADD_COLUMNS = """\ +DELETE FROM embedded_graphing_queries; + +ALTER TABLE embedded_graphing_queries +DROP COLUMN last_accessed; + +ALTER TABLE embedded_graphing_queries +ADD COLUMN ( + last_updated DATETIME NOT NULL, + refresh_time DATETIME DEFAULT NULL, + cached_png MEDIUMBLOB +); +""" + +DROP_COLUMNS = """\ +ALTER TABLE embedded_graphing_queries +DROP COLUMN last_updated; + +ALTER TABLE embedded_graphing_queries +DROP COLUMN cached_png; + +ALTER TABLE embedded_graphing_queries +DROP COLUMN refresh_time; + +ALTER TABLE embedded_graphing_queries +ADD COLUMN (last_accessed DATETIME NOT NULL); +""" |