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

Unified Diff: tools/telemetry/examples/benchmarks/message_loop_benchmark.py

Issue 1368533002: [Telemetry] Add an example for adding an end to end Telemetry benchmark (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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/telemetry/examples/benchmarks/message_loop_benchmark.py
diff --git a/tools/telemetry/examples/benchmarks/message_loop_benchmark.py b/tools/telemetry/examples/benchmarks/message_loop_benchmark.py
new file mode 100644
index 0000000000000000000000000000000000000000..0f63be31fca6063fd9ccc287a42b024a2b57c156
--- /dev/null
+++ b/tools/telemetry/examples/benchmarks/message_loop_benchmark.py
@@ -0,0 +1,27 @@
+# Copyright 2015 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+from telemetry import benchmark
+from telemetry.timeline import tracing_category_filter
+from telemetry.web_perf import timeline_based_measurement
+
+from benchmarks import simple_story_set
+from benchmarks import message_loop_metric
+
+
+class MessageLoopBenchmark(benchmark.Benchmark):
+
+ def CreateStorySet(self, options):
+ return simple_story_set.SimpleStorySet()
+
+ def CreateTimelineBasedMeasurementOptions(self):
+ cat_filter = tracing_category_filter.CreateMinimalOverheadFilter()
+ cat_filter.AddIncludedCategory('*')
eakuefner 2015/10/30 00:14:55 Can we maybe expand this to first add blink.consol
nednguyen 2015/10/30 16:29:56 Good call
+ options = timeline_based_measurement.Options(overhead_level=cat_filter)
+ options.SetTimelineBasedMetrics(
+ [message_loop_metric.MessageLoopLatencyMetric()])
+ return options
+
+ @classmethod
+ def Name(cls):
+ return 'message_loop_counter.simple_story'

Powered by Google App Engine
This is Rietveld 408576698