diff options
author | anandc <anandc@chromium.org> | 2015-04-22 16:14:05 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-04-22 23:15:05 +0000 |
commit | 74e6ec0e39513315d561d570c7836a5df917b3df (patch) | |
tree | ab8fe36d322c4022c73598201629ee63fe3a960f /remoting | |
parent | 00e51a363a532f1e2c0d2defcf9035e7bf33ddc0 (diff) | |
download | chromium_src-74e6ec0e39513315d561d570c7836a5df917b3df.zip chromium_src-74e6ec0e39513315d561d570c7836a5df917b3df.tar.gz chromium_src-74e6ec0e39513315d561d570c7836a5df917b3df.tar.bz2 |
Exclude manual PIN-entry time in calculation of session durations.
There will be a separate CL to do the same for the third-party authentication flow. That requires a modification of remoting.ThirdPartyTokenFetcher in order to get access to the logToServer_ object of a client-session.
BUG=462725
Review URL: https://codereview.chromium.org/1096383004
Cr-Commit-Position: refs/heads/master@{#326390}
Diffstat (limited to 'remoting')
-rw-r--r-- | remoting/webapp/crd/js/log_to_server.js | 15 | ||||
-rw-r--r-- | remoting/webapp/crd/js/me2me_activity.js | 5 |
2 files changed, 19 insertions, 1 deletions
diff --git a/remoting/webapp/crd/js/log_to_server.js b/remoting/webapp/crd/js/log_to_server.js index 87cb039..e76f67a 100644 --- a/remoting/webapp/crd/js/log_to_server.js +++ b/remoting/webapp/crd/js/log_to_server.js @@ -29,6 +29,8 @@ remoting.LogToServer = function(signalStrategy) { this.signalStrategy_ = signalStrategy; /** @private {string} */ this.connectionType_ = ''; + /** @private */ + this.authTotalTime_ = 0; this.setSessionId_(); signalStrategy.sendConnectionSetupResults(this); @@ -171,8 +173,10 @@ remoting.LogToServer.prototype.logAccumulatedStatistics_ = function() { */ remoting.LogToServer.prototype.log_ = function(entry) { // Log the time taken to get to this point from the time this session started. + // Exclude time taken for authorization. var sessionDurationInSeconds = - (new Date().getTime() - this.sessionStartTime_) / 1000.0; + (new Date().getTime() - this.sessionStartTime_ - + this.authTotalTime_) / 1000.0; entry.addSessionDuration(sessionDurationInSeconds); // Send the stanza to the debug log. @@ -247,3 +251,12 @@ remoting.LogToServer.generateSessionId_ = function() { } return idArray.join(''); }; + +/** + * @param {number} totalTime The value of time taken to complete authorization. + * @return {void} Nothing. + */ +remoting.LogToServer.prototype.setAuthTotalTime = function(totalTime) { + this.authTotalTime_ = totalTime; +}; + diff --git a/remoting/webapp/crd/js/me2me_activity.js b/remoting/webapp/crd/js/me2me_activity.js index 7d2b090..0618464 100644 --- a/remoting/webapp/crd/js/me2me_activity.js +++ b/remoting/webapp/crd/js/me2me_activity.js @@ -104,8 +104,13 @@ remoting.Me2MeActivity.prototype.createCredentialsProvider_ = function() { * @param {function(string):void} onPinFetched */ var requestPin = function(supportsPairing, onPinFetched) { + // Set time when PIN was requested. + var authStartTime = new Date().getTime(); that.pinDialog_.show(supportsPairing).then(function(/** string */ pin) { remoting.setMode(remoting.AppMode.CLIENT_CONNECTING); + // Done obtaining PIN information. Log time taken for PIN entry. + var logToServer = that.desktopActivity_.getSession().getLogger(); + logToServer.setAuthTotalTime(new Date().getTime() - authStartTime); onPinFetched(pin); }).catch(function(/** remoting.Error */ error) { base.debug.assert(error.hasTag(remoting.Error.Tag.CANCELLED)); |