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

Side by Side Diff: tracing/tracing/base/timing.html

Issue 2999863002: Results.html: record maximum Histogram.numValues in google analytics. (Closed)
Patch Set: fix vinn tests 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 unified diff | Download patch
« no previous file with comments | « no previous file | tracing/tracing/value/histogram_parameter_collector.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <!-- 2 <!--
3 Copyright (c) 2014 The Chromium Authors. All rights reserved. 3 Copyright (c) 2014 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be 4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file. 5 found in the LICENSE file.
6 --> 6 -->
7 7
8 <link rel="import" href="/tracing/base/guid.html"> 8 <link rel="import" href="/tracing/base/guid.html">
9 <link rel="import" href="/tracing/base/utils.html"> 9 <link rel="import" href="/tracing/base/utils.html">
10 10
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 } 71 }
72 } 72 }
73 73
74 class Timing { 74 class Timing {
75 static mark(groupName, functionName) { 75 static mark(groupName, functionName) {
76 return new Mark(groupName, functionName); 76 return new Mark(groupName, functionName);
77 } 77 }
78 78
79 static instant(groupName, functionName, opt_value) { 79 static instant(groupName, functionName, opt_value) {
80 const valueString = opt_value === undefined ? '' : ' ' + opt_value; 80 const valueString = opt_value === undefined ? '' : ' ' + opt_value;
81 // eslint-disable-next-line no-console
82 console.timeStamp(`${groupName} ${functionName}${valueString}`);
83 81
84 if (!(window.ga instanceof Function)) return; 82 /* eslint-disable no-console */
83 if (console && console.timeStamp) {
84 console.timeStamp(`${groupName} ${functionName}${valueString}`);
85 }
86 /* eslint-enable no-console */
87
85 // Google Analytics 88 // Google Analytics
86 ga('send', { 89 if (window && window.ga instanceof Function) {
87 hitType: 'event', 90 ga('send', {
88 eventCategory: groupName, 91 hitType: 'event',
89 eventAction: functionName, 92 eventCategory: groupName,
90 eventValue: opt_value, 93 eventAction: functionName,
91 }); 94 eventValue: opt_value,
95 });
96 }
92 } 97 }
93 } 98 }
94 99
95 return { 100 return {
96 Timing, 101 Timing,
97 }; 102 };
98 }); 103 });
99 </script> 104 </script>
OLDNEW
« no previous file with comments | « no previous file | tracing/tracing/value/histogram_parameter_collector.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698