summaryrefslogtreecommitdiff
path: root/tko/machine_benchmark.cgi
diff options
context:
space:
mode:
authormbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-01-16 01:30:19 +0000
committermbligh <mbligh@592f7852-d20e-0410-864c-8624ca9c26a4>2008-01-16 01:30:19 +0000
commiteb070099c6aaf7acef324a6122e60a6b9c167a83 (patch)
treebdc18dc0bbdf9a350076f2437667616bf4032d59 /tko/machine_benchmark.cgi
parent50989131251a4d900e568b509b15d64d1b2584db (diff)
Clean up the reporting backend, and add CLI functionality
I've pulled out the generic bits into frontend.py. There are way too many things called "row" and "column" so I've changed the matrix iterators to "x" and "y" to be less confusing Removed all the old, specific query reports, in favour of the new, powerful general one Signed-off-by: Martin Bligh <mbligh@google.com> git-svn-id: svn://test.kernel.org/autotest/trunk@1166 592f7852-d20e-0410-864c-8624ca9c26a4
Diffstat (limited to 'tko/machine_benchmark.cgi')
-rwxr-xr-xtko/machine_benchmark.cgi70
1 files changed, 0 insertions, 70 deletions
diff --git a/tko/machine_benchmark.cgi b/tko/machine_benchmark.cgi
index d0b1aef0..e69de29b 100755
--- a/tko/machine_benchmark.cgi
+++ b/tko/machine_benchmark.cgi
@@ -1,70 +0,0 @@
-#!/usr/bin/python
-print "Content-type: text/html\n"
-import cgi, cgitb, os, sys, re
-sys.stdout.flush()
-cgitb.enable()
-
-tko = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0])))
-sys.path.insert(0, tko)
-import db, display, frontend
-
-db = db.db()
-
-benchmark_key = {
-'kernbench' : 'elapsed',
-'dbench' : 'throughput',
-'tbench' : 'throughput',
-}
-
-def main():
-
- display.print_main_header()
-
- rows = db.select('test', 'tests', {}, distinct = True)
- benchmarks = []
- for row in rows:
- benchmark = row[0]
- testname = re.sub(r'\..*', '', benchmark)
- if not benchmark_key.has_key(testname):
- continue
- benchmarks.append(benchmark)
- benchmarks = display.sort_tests(benchmarks)
-
- machine_idx = {}
- benchmark_data = {}
- for benchmark in benchmarks:
- fields = 'machine_idx,machine_hostname,count(status_word)'
- where = { 'subdir': benchmark, 'status_word' : 'GOOD' }
- data = {}
- for (idx, machine, count) in db.select(fields, 'test_view',
- where, group_by = 'machine_hostname'):
- data[machine] = count
- machine_idx[machine] = idx
- benchmark_data[benchmark] = data
-
- print '<h1>Performance</h1>'
-
- header_row = [ display.box('Benchmark', header=True) ]
- header_row += [ display.box(re.sub(r'\.', '<br>', benchmark), header=True) for benchmark in benchmarks ]
-
- matrix = [header_row]
- for machine in machine_idx:
- row = [display.box(machine)]
- for benchmark in benchmarks:
- count = benchmark_data[benchmark].get(machine, None)
- if not count:
- row.append(display.box(None))
- continue
- key = benchmark_key[re.sub(r'\..*', '', benchmark)]
- url = 'machine_test_attribute_graph.cgi'
- url += '?machine=' + str(machine_idx[machine])
- url += '&benchmark=' + benchmark
- url += '&key=' + key
- html = '<a href="%s">%d</a>' % (url, count)
- row.append(display.box(html))
- matrix.append(row)
- matrix.append(header_row)
-
- display.print_table(matrix)
-
-main()