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 |