| OLD | NEW |
| 1 #!/usr/bin/python | 1 #!/usr/bin/python |
| 2 | 2 |
| 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
| 5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
| 6 | 6 |
| 7 import datetime | 7 import datetime |
| 8 import getpass | 8 import getpass |
| 9 import math | 9 import math |
| 10 from matplotlib.font_manager import FontProperties | 10 from matplotlib.font_manager import FontProperties |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 'perf_testing')) | 188 'perf_testing')) |
| 189 for data in [BROWSER_PERF, TIME_SIZE, CL_PERF]: | 189 for data in [BROWSER_PERF, TIME_SIZE, CL_PERF]: |
| 190 path = os.path.join('appengine', 'static', 'data', data, utils.GuessOS()) | 190 path = os.path.join('appengine', 'static', 'data', data, utils.GuessOS()) |
| 191 shutil.rmtree(path, ignore_errors=True) | 191 shutil.rmtree(path, ignore_errors=True) |
| 192 os.makedirs(path) | 192 os.makedirs(path) |
| 193 files = [] | 193 files = [] |
| 194 # Copy the 1000 most recent trace files to be uploaded. | 194 # Copy the 1000 most recent trace files to be uploaded. |
| 195 for f in os.listdir(data): | 195 for f in os.listdir(data): |
| 196 files += [(os.path.getmtime(os.path.join(data, f)), f)] | 196 files += [(os.path.getmtime(os.path.join(data, f)), f)] |
| 197 files.sort() | 197 files.sort() |
| 198 for f in files[-1000]: | 198 for f in files[-1000:]: |
| 199 shutil.copyfile(os.path.join(data, f[1]), | 199 shutil.copyfile(os.path.join(data, f[1]), |
| 200 os.path.join(path, f[1]+'.txt')) | 200 os.path.join(path, f[1]+'.txt')) |
| 201 # Generate directory listing. | 201 # Generate directory listing. |
| 202 for data in [BROWSER_PERF, TIME_SIZE, CL_PERF]: | 202 for data in [BROWSER_PERF, TIME_SIZE, CL_PERF]: |
| 203 path = os.path.join('appengine', 'static', 'data', data, utils.GuessOS()) | 203 path = os.path.join('appengine', 'static', 'data', data, utils.GuessOS()) |
| 204 out = open(os.path.join('appengine', 'static', | 204 out = open(os.path.join('appengine', 'static', |
| 205 '%s-%s.html' % (data, utils.GuessOS())), 'w') | 205 '%s-%s.html' % (data, utils.GuessOS())), 'w') |
| 206 out.write('<html>\n <body>\n <ul>\n') | 206 out.write('<html>\n <body>\n <ul>\n') |
| 207 for f in os.listdir(path): | 207 for f in os.listdir(path): |
| 208 if not f.startswith('.'): | 208 if not f.startswith('.'): |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 self.style_and_save_perf_plot( | 379 self.style_and_save_perf_plot( |
| 380 'Performance of %s over time on the %s on %s' % (benchmark, | 380 'Performance of %s over time on the %s on %s' % (benchmark, |
| 381 self.platform_type, utils.GuessOS()), 'Speed (bigger = better)', 16, | 381 self.platform_type, utils.GuessOS()), 'Speed (bigger = better)', 16, |
| 382 14, 'lower left', benchmark + png_filename, self.platform_list, | 382 14, 'lower left', benchmark + png_filename, self.platform_list, |
| 383 get_versions(), [benchmark]) | 383 get_versions(), [benchmark]) |
| 384 | 384 |
| 385 def plot_avg_perf(self, png_filename): | 385 def plot_avg_perf(self, png_filename): |
| 386 """Generate a plot that shows the performance changes of the geomentric mean | 386 """Generate a plot that shows the performance changes of the geomentric mean |
| 387 of JS and frog benchmark performance over svn history.""" | 387 of JS and frog benchmark performance over svn history.""" |
| 388 (title, y_axis, size_x, size_y, loc, filename) = \ | 388 (title, y_axis, size_x, size_y, loc, filename) = \ |
| 389 ('Geometric Mean of benchmark %s performance' % self.platform_type, | 389 ('Geometric Mean of benchmark %s performance on %s ' % |
| 390 'Speed (bigger = better)', 16, 5, 'lower left', 'avg'+png_filename) | 390 (self.platform_type, utils.GuessOS()), 'Speed (bigger = better)', 16, 5, |
| 391 'lower left', 'avg'+png_filename) |
| 391 clear_axis = True | 392 clear_axis = True |
| 392 for platform in self.platform_list: | 393 for platform in self.platform_list: |
| 393 self.style_and_save_perf_plot(title, y_axis, size_x, size_y, loc, | 394 self.style_and_save_perf_plot(title, y_axis, size_x, size_y, loc, |
| 394 filename, [platform], [JS], [JS_MEAN], clear_axis) | 395 filename, [platform], [JS], [JS_MEAN], clear_axis) |
| 395 clear_axis = False | 396 clear_axis = False |
| 396 self.style_and_save_perf_plot(title, y_axis, size_x, size_y, loc, | 397 self.style_and_save_perf_plot(title, y_axis, size_x, size_y, loc, |
| 397 filename, [platform], [FROG], [FROG_MEAN], clear_axis) | 398 filename, [platform], [FROG], [FROG_MEAN], clear_axis) |
| 398 | 399 |
| 399 def plot_results(self, png_filename): | 400 def plot_results(self, png_filename): |
| 400 self.plot_all_perf(png_filename) | 401 self.plot_all_perf(png_filename) |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 764 while True: | 765 while True: |
| 765 if has_new_code(): | 766 if has_new_code(): |
| 766 run_test_sequence(cl, size, language, perf, username, password) | 767 run_test_sequence(cl, size, language, perf, username, password) |
| 767 else: | 768 else: |
| 768 time.sleep(SLEEP_TIME) | 769 time.sleep(SLEEP_TIME) |
| 769 else: | 770 else: |
| 770 run_test_sequence(cl, size, language, perf, username, password) | 771 run_test_sequence(cl, size, language, perf, username, password) |
| 771 | 772 |
| 772 if __name__ == '__main__': | 773 if __name__ == '__main__': |
| 773 main() | 774 main() |
| OLD | NEW |