Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(161)

Side by Side Diff: tools/perf/perf_tools/loading_benchmark.py

Issue 12278015: [Telemetry] Reorganize everything. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Re-add shebangs. Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/perf/perf_tools/kraken.py ('k') | tools/perf/perf_tools/loading_benchmark_unittest.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import collections 5 import collections
6 6
7 from telemetry import multi_page_benchmark 7 from telemetry.core import util
8 from telemetry import util 8 from telemetry.page import multi_page_benchmark
9 9
10 class LoadingBenchmark(multi_page_benchmark.MultiPageBenchmark): 10 class LoadingBenchmark(multi_page_benchmark.MultiPageBenchmark):
11 @property 11 @property
12 def results_are_the_same_on_every_page(self): 12 def results_are_the_same_on_every_page(self):
13 return False 13 return False
14 14
15 def WillNavigateToPage(self, page, tab): 15 def WillNavigateToPage(self, page, tab):
16 tab.StartTimelineRecording() 16 tab.StartTimelineRecording()
17 17
18 def MeasurePage(self, page, tab, results): 18 def MeasurePage(self, page, tab, results):
(...skipping 24 matching lines...) Expand all
43 for e in events: 43 for e in events:
44 events_by_name[e.name].append(e) 44 events_by_name[e.name].append(e)
45 45
46 for key, group in events_by_name.items(): 46 for key, group in events_by_name.items():
47 times = [e.self_time_ms for e in group] 47 times = [e.self_time_ms for e in group]
48 total = sum(times) 48 total = sum(times)
49 biggest_jank = max(times) 49 biggest_jank = max(times)
50 results.Add(key, 'ms', total) 50 results.Add(key, 'ms', total)
51 results.Add(key + '_max', 'ms', biggest_jank) 51 results.Add(key + '_max', 'ms', biggest_jank)
52 results.Add(key + '_avg', 'ms', total / len(times)) 52 results.Add(key + '_avg', 'ms', total / len(times))
OLDNEW
« no previous file with comments | « tools/perf/perf_tools/kraken.py ('k') | tools/perf/perf_tools/loading_benchmark_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698