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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tracing/tracing/value/histogram_parameter_collector.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tracing/tracing/base/timing.html
diff --git a/tracing/tracing/base/timing.html b/tracing/tracing/base/timing.html
index 94b792252a323338e290a7384899e4dda84db1df..ef065462b4143d804e1c97983200af44cd217298 100644
--- a/tracing/tracing/base/timing.html
+++ b/tracing/tracing/base/timing.html
@@ -78,17 +78,22 @@ tr.exportTo('tr.b', function() {
static instant(groupName, functionName, opt_value) {
const valueString = opt_value === undefined ? '' : ' ' + opt_value;
- // eslint-disable-next-line no-console
- console.timeStamp(`${groupName} ${functionName}${valueString}`);
- if (!(window.ga instanceof Function)) return;
+ /* eslint-disable no-console */
+ if (console && console.timeStamp) {
+ console.timeStamp(`${groupName} ${functionName}${valueString}`);
+ }
+ /* eslint-enable no-console */
+
// Google Analytics
- ga('send', {
- hitType: 'event',
- eventCategory: groupName,
- eventAction: functionName,
- eventValue: opt_value,
- });
+ if (window && window.ga instanceof Function) {
+ ga('send', {
+ hitType: 'event',
+ eventCategory: groupName,
+ eventAction: functionName,
+ eventValue: opt_value,
+ });
+ }
}
}
« 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