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

Unified Diff: tools/telemetry/examples/benchmarks/v8_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: Address Kari's comments Created 5 years, 1 month 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/v8_benchmark.py
diff --git a/tools/telemetry/examples/benchmarks/v8_benchmark.py b/tools/telemetry/examples/benchmarks/v8_benchmark.py
new file mode 100644
index 0000000000000000000000000000000000000000..fdee6670f868ae430cce308d20e88bdb2ea35e87
--- /dev/null
+++ b/tools/telemetry/examples/benchmarks/v8_benchmark.py
@@ -0,0 +1,30 @@
+# 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 v8_metric
+
+
+class MessageLoopBenchmark(benchmark.Benchmark):
+
+ def CreateStorySet(self, options):
+ return simple_story_set.SimpleStorySet()
+
+ def CreateTimelineBasedMeasurementOptions(self):
+ cat_filter = tracing_category_filter.CreateNoOverheadFilter()
+ # blink.console category is required to make sure that Chrome can output
+ # interaction records in its tracing data.
+ cat_filter.AddIncludedCategory('blink.console')
+ cat_filter.AddIncludedCategory('v8')
+ options = timeline_based_measurement.Options(overhead_level=cat_filter)
+ options.SetTimelineBasedMetrics(
+ [v8_metric.MessageLoopLatencyMetric()])
+ return options
+
+ @classmethod
+ def Name(cls):
+ return 'v8_latency.simple_story'
« no previous file with comments | « tools/telemetry/examples/benchmarks/simple_story_set.py ('k') | tools/telemetry/examples/benchmarks/v8_metric.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698