| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 the V8 project authors. All rights reserved. | 2 # Copyright 2015 the V8 project authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 ''' | 5 ''' |
| 6 python %prog | 6 python %prog |
| 7 | 7 |
| 8 Convert a perf trybot JSON file into a pleasing HTML page. It can read | 8 Convert a perf trybot JSON file into a pleasing HTML page. It can read |
| 9 from standard input or via the --filename option. Examples: | 9 from standard input or via the --filename option. Examples: |
| 10 | 10 |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 108 |
| 109 def isNotablyNegative(self): | 109 def isNotablyNegative(self): |
| 110 return self.notable_ < 0 | 110 return self.notable_ < 0 |
| 111 | 111 |
| 112 | 112 |
| 113 class Benchmark: | 113 class Benchmark: |
| 114 def __init__(self, name, data): | 114 def __init__(self, name, data): |
| 115 self.name_ = name | 115 self.name_ = name |
| 116 self.tests_ = {} | 116 self.tests_ = {} |
| 117 for test in data: | 117 for test in data: |
| 118 # strip off "<name>/" prefix | 118 # strip off "<name>/" prefix, allowing for subsequent "/"s |
| 119 test_name = test.split("/")[1] | 119 test_name = test.split("/", 1)[1] |
| 120 self.appendResult(test_name, data[test]) | 120 self.appendResult(test_name, data[test]) |
| 121 | 121 |
| 122 # tests is a dictionary of Results | 122 # tests is a dictionary of Results |
| 123 def tests(self): | 123 def tests(self): |
| 124 return self.tests_ | 124 return self.tests_ |
| 125 | 125 |
| 126 def SortedTestKeys(self): | 126 def SortedTestKeys(self): |
| 127 keys = self.tests_.keys() | 127 keys = self.tests_.keys() |
| 128 keys.sort() | 128 keys.sort() |
| 129 t = "Total" | 129 t = "Total" |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 369 parser.add_option("-f", "--filename", dest="filename", | 369 parser.add_option("-f", "--filename", dest="filename", |
| 370 help="Specifies the filename for the JSON results " | 370 help="Specifies the filename for the JSON results " |
| 371 "rather than reading from stdin.") | 371 "rather than reading from stdin.") |
| 372 parser.add_option("-t", "--title", dest="title", | 372 parser.add_option("-t", "--title", dest="title", |
| 373 help="Optional title of the web page.") | 373 help="Optional title of the web page.") |
| 374 parser.add_option("-o", "--output", dest="output", | 374 parser.add_option("-o", "--output", dest="output", |
| 375 help="Write html output to this file rather than stdout.") | 375 help="Write html output to this file rather than stdout.") |
| 376 | 376 |
| 377 (opts, args) = parser.parse_args() | 377 (opts, args) = parser.parse_args() |
| 378 Render(opts, args) | 378 Render(opts, args) |
| OLD | NEW |