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

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: Add Chromoting actions to actions.xml. Fix durations calculations. 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..4391c2ea1b3deb31bb165fa2f8fb3cf097e686d7 100644
--- a/remoting/webapp/base/js/client_session.js
+++ b/remoting/webapp/base/js/client_session.js
@@ -581,6 +581,8 @@ remoting.ClientSession.prototype.notifyStateChanges_ =
var error;
switch (this.state_) {
case remoting.ClientSession.State.CONNECTED:
+ chrome.metricsPrivate.recordUserAction(
kelvinp 2015/08/20 23:21:23 I think this will break our unit tests, as chrome.
anandc 2015/08/21 03:15:42 I ran ./remoting/tools/run_webapp_unittests.py and
+ 'Chromoting.Connections.Connected');
console.log('Connection established.');
var connectionInfo = new remoting.ConnectionInfo(
this.host_, this.credentialsProvider_, this, this.plugin_);
@@ -588,12 +590,16 @@ remoting.ClientSession.prototype.notifyStateChanges_ =
break;
case remoting.ClientSession.State.CONNECTING:
+ chrome.metricsPrivate.recordUserAction(
+ 'Chromoting.Connections.Connecting');
remoting.identity.getEmail().then(function(/** string */ email) {
console.log('Connecting as ' + email);
});
break;
case remoting.ClientSession.State.AUTHENTICATED:
+ chrome.metricsPrivate.recordUserAction(
+ 'Chromoting.Connections.Authenticated');
console.log('Connection authenticated.');
break;
@@ -602,6 +608,7 @@ remoting.ClientSession.prototype.notifyStateChanges_ =
break;
case remoting.ClientSession.State.CLOSED:
+ chrome.metricsPrivate.recordUserAction('Chromoting.Connections.Closed');
console.log('Connection closed.');
this.listener_.onDisconnected(remoting.Error.none());
break;
@@ -610,6 +617,7 @@ remoting.ClientSession.prototype.notifyStateChanges_ =
case remoting.ClientSession.State.FAILED:
error = this.getError();
if (!error.isNone()) {
+ chrome.metricsPrivate.recordUserAction('Chromoting.Connections.Failed');
console.error('Connection failed: ' + error.toString());
}
this.listener_.onConnectionFailed(error);
@@ -619,6 +627,7 @@ remoting.ClientSession.prototype.notifyStateChanges_ =
error = this.getError();
console.error('Connection dropped: ' + error.toString());
this.listener_.onDisconnected(error);
+ chrome.metricsPrivate.recordUserAction('Chromoting.Connections.Dropped');
break;
default:

Powered by Google App Engine
This is Rietveld 408576698