mbligh | f28cb4b | 2007-09-20 17:33:19 +0000 | [diff] [blame^] | 1 | #!/usr/bin/python |
| 2 | |
| 3 | # http://test.kernel.org/perf/kernbench.elm3b6.png |
| 4 | |
| 5 | import cgi, cgitb, os, sys, re, subprocess |
| 6 | cgitb.enable() |
| 7 | Popen = subprocess.Popen |
| 8 | |
| 9 | tko = os.path.dirname(os.path.realpath(os.path.abspath(sys.argv[0]))) |
| 10 | sys.path.insert(0, tko) |
| 11 | import db, display, frontend, plotgraph |
| 12 | client_bin = os.path.abspath(os.path.join(tko, '../client/bin')) |
| 13 | sys.path.insert(0, client_bin) |
| 14 | import kernel_versions |
| 15 | |
| 16 | db = db.db() |
| 17 | |
| 18 | def main(): |
| 19 | # form = cgi.FieldStorage() |
| 20 | # if not form.has_key("machine") and form.has_key("kernel"): |
| 21 | # raise |
| 22 | # |
| 23 | # machine = form["machine"].value |
| 24 | # kernel_version = form["kernel"].value |
| 25 | # draw_graph("A test graph", "Kernel", "Elapsed time (seconds)") |
| 26 | print "Content-type: text/html\n" |
| 27 | sys.stdout.flush() |
| 28 | machine = 'cagg4' |
| 29 | where = { 'subdir' : 'kernbench', 'machine' : machine } |
| 30 | tests = frontend.test.select(db, where) |
| 31 | kernels.sort(key = kernel_encode) |
| 32 | |
| 33 | |
| 34 | |
| 35 | def draw_graph(title, xlabel, ylabel): |
| 36 | graph = plotgraph.gnuplot(title, xlabel, ylabel) |
| 37 | graph.set_xlabels(["2.6.0", "2.6.1", "2.6.2"]) |
| 38 | graph.add_dataset('foo', ["10 0.5", "11 1", "12 2"]) |
| 39 | graph.add_dataset('bar', ["13 0.5", "10 0.2", "9 0.1"]) |
| 40 | graph.plot(cgi_header = True) |
| 41 | |
| 42 | |
| 43 | main() |