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

Unified Diff: tracing/tracing/metrics/vr/webvr_metric.html

Issue 3001843002: Add TBMv2 metrics for WebVR. (Closed)
Patch Set: Addressed Ben's comments Created 3 years, 4 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
« no previous file with comments | « tracing/tracing/metrics/all_metrics.html ('k') | tracing/tracing/metrics/vr/webvr_metric_test.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/metrics/vr/webvr_metric.html
diff --git a/tracing/tracing/metrics/vr/webvr_metric.html b/tracing/tracing/metrics/vr/webvr_metric.html
new file mode 100644
index 0000000000000000000000000000000000000000..3674d377455a1a3de9cb10427b646320b4499da2
--- /dev/null
+++ b/tracing/tracing/metrics/vr/webvr_metric.html
@@ -0,0 +1,78 @@
+<!DOCTYPE html>
+<!--
+Copyright 2017 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.
+-->
+
+<link rel="import" href="/tracing/metrics/metric_registry.html">
+<link rel="import" href="/tracing/value/histogram.html">
+
+<script>
+'use strict';
+
+tr.exportTo('tr.metrics.vr', function() {
+ function webvrMetric(histograms, model) {
+ // Maps VR trace counters to histogram.
+ const WEBVR_COUNTERS = new Map([
+ ['gpu.WebVR FPS', new Map([
+ ['name', 'webvr_fps'],
+ ['unit', tr.b.Unit.byName.count_biggerIsBetter],
+ ['options', new Map([
+ ['description', 'WebVR frame per second'],
+ ['binBoundaries',
+ tr.v.HistogramBinBoundaries.createLinear(20, 120, 25)]
+ ])]
+ ])],
+ ['gpu.WebVR frame time (ms)', new Map([
+ ['name', 'webvr_frame_time'],
+ ['unit', tr.b.Unit.byName.timeDurationInMs_smallerIsBetter],
+ ['options', new Map([
+ ['description', 'WebVR frame time in ms'],
+ ['binBoundaries',
+ tr.v.HistogramBinBoundaries.createLinear(20, 120, 25)]
+ ])]
+ ])],
+ ['gpu.WebVR pose prediction (ms)', new Map([
+ ['name', 'webvr_pose_prediction'],
+ ['unit', tr.b.Unit.byName.timeDurationInMs_smallerIsBetter],
+ ['options', new Map([
+ ['description', 'WebVR pose prediction in ms'],
+ ['binBoundaries',
+ tr.v.HistogramBinBoundaries.createLinear(20, 120, 25)]
+ ])]
+ ])]
+ ]);
+
+ for (const counter of model.getAllCounters()) {
+ if (!(WEBVR_COUNTERS.has(counter.id))) continue;
+
+ const nameToSamples = new Map();
+ for (const series of counter.series) {
+ nameToSamples[series.name] = nameToSamples[series.name] || [];
+ for (const sample of series.samples) {
+ nameToSamples[series.name].push(sample.value);
+ }
+ }
+
+ for (const [seriesName, samples] of Object.entries(nameToSamples)) {
+ let name = WEBVR_COUNTERS.get(counter.id).get('name');
+ if (seriesName !== 'value') {
+ name = name + '_' + seriesName;
+ }
+
+ histograms.createHistogram(
+ name, WEBVR_COUNTERS.get(counter.id).get('unit'), samples,
+ WEBVR_COUNTERS.get(counter.id).get('options')
+ );
+ }
+ }
+ }
+
+ tr.metrics.MetricRegistry.register(webvrMetric);
+
+ return {
+ webvrMetric,
+ };
+});
+</script>
« no previous file with comments | « tracing/tracing/metrics/all_metrics.html ('k') | tracing/tracing/metrics/vr/webvr_metric_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698