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

Unified Diff: remoting/webapp/base/js/client_session.js

Issue 1305453002: Add UMA stats for Chromoting connection details. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use enum histogram instead of user actions for connection states. Created 5 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
Index: remoting/webapp/base/js/client_session.js
diff --git a/remoting/webapp/base/js/client_session.js b/remoting/webapp/base/js/client_session.js
index 329decea3d212eefa74c3b3093d4bd65f85df4c4..d0087438656d7f703b1d3c66264525b0d14922c6 100644
--- a/remoting/webapp/base/js/client_session.js
+++ b/remoting/webapp/base/js/client_session.js
@@ -566,11 +566,31 @@ remoting.ClientSession.prototype.setState_ = function(newState) {
}
this.notifyStateChanges_(oldState, this.state_);
+ if (this.state_ > 1) {
kelvinp 2015/08/21 16:29:23 Currently initializing doesn't fire so this check
anandc 2015/08/21 18:56:56 Done.
+ // Record state in an UMA histogram if it is after initializing.
+ recordState(this.state_);
+ }
this.logger_.logClientSessionStateChange(
this.state_, this.error_, this.xmppErrorCache_.getFirstError());
};
/**
+ * Records a Chromoting Connection State.
+ * @param {remoting.ClientSession.State} state State identifier.
+ */
+function recordState(state) {
+ var metricDescription = {
+ metricName: 'Chromoting.Connections',
+ type: 'histogram-linear',
+ min: 2,
kelvinp 2015/08/21 16:29:24 Use enum values from remoting.ClientSession.State
anandc 2015/08/21 18:56:56 Done.
+ max: 7,
kelvinp 2015/08/21 16:29:23 The enum range is not consecutive, for example CON
anandc 2015/08/21 18:56:56 Thanks. PTAL at the latest implementation. I consi
+ buckets: 7
anandc 2015/08/21 16:23:01 We only want to log when the connection state is a
+ };
+
+ chrome.metricsPrivate.recordValue(metricDescription, state);
+}
+
+/**
* @param {remoting.ClientSession.State} oldState The new state for the session.
* @param {remoting.ClientSession.State} newState The new state for the session.
* @private

Powered by Google App Engine
This is Rietveld 408576698