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

Unified Diff: tools/perf/perf_tools/image_decoding_benchmark.py

Issue 11753023: [telemetry] Clean up image decoding benchmark (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: helps if i upload a working patch Created 7 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: tools/perf/perf_tools/image_decoding_benchmark.py
diff --git a/tools/perf/perf_tools/image_decoding_benchmark.py b/tools/perf/perf_tools/image_decoding_benchmark.py
index e23113445debda915ede4c72323cb2e282c990ae..ef85c5feffb18e3eead0bf2649cd20d36eb5b65c 100644
--- a/tools/perf/perf_tools/image_decoding_benchmark.py
+++ b/tools/perf/perf_tools/image_decoding_benchmark.py
@@ -3,20 +3,29 @@
# found in the LICENSE file.
from telemetry import multi_page_benchmark
-from telemetry import util
class ImageDecoding(multi_page_benchmark.MultiPageBenchmark):
- def MeasurePage(self, _, tab, results):
+ def WillNavigateToPage(self, page, tab):
+ tab.timeline.Start()
+
+ def MeasurePage(self, page, tab, results):
+ tab.timeline.Stop()
def _IsDone():
return tab.runtime.Evaluate('isDone')
- with tab.timeline.Recorder(tab.timeline):
- tab.runtime.Execute('runBenchmark()')
- util.WaitFor(_IsDone, 60)
- iterations = tab.runtime.Evaluate('minIterations')
- decode_image = tab.timeline.timeline_events.GetAllOfType('DecodeImage')
- elapsed_times = [d.elapsed_time for d in decode_image[-iterations:]]
+ decode_image_events = \
+ tab.timeline.timeline_events.GetAllOfType('DecodeImage')
+
+ # If it is a real image benchmark, then store only the last-minIterations
+ # decode tasks.
+ if (hasattr(page, 'is_image_decoding_benchmark') and
+ page.is_image_decoding_benchmark):
+ assert _IsDone()
+ max_event_count = tab.runtime.Evaluate('minIterations')
+ decode_image_events = decode_image_events[-max_event_count:]
+
+ elapsed_times = [d.elapsed_time for d in decode_image_events]
if not elapsed_times:
results.Add('ImageDecoding_avg', 'ms', 'unsupported')
return

Powered by Google App Engine
This is Rietveld 408576698