diff options
author | anandc <anandc@chromium.org> | 2015-03-04 18:58:20 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-03-05 02:58:51 +0000 |
commit | bd907bb661972284eab39dd75fcf5dcd5eb54868 (patch) | |
tree | 026838ff6df9d39c89eb6f3a1f3d0a4fdaf199dd /remoting/webapp | |
parent | e73c0b43a0fb4c8a93ba8e8155111a285294117f (diff) | |
download | chromium_src-bd907bb661972284eab39dd75fcf5dcd5eb54868.zip chromium_src-bd907bb661972284eab39dd75fcf5dcd5eb54868.tar.gz chromium_src-bd907bb661972284eab39dd75fcf5dcd5eb54868.tar.bz2 |
Rename elapsed-time field in Chromoting log events to session-duration, and record time in seconds, to align with server-side field names and units.
BUG=461610
Tested by running run_webapp_unittest.py with these changes; all tests passed.
Review URL: https://codereview.chromium.org/961053004
Cr-Commit-Position: refs/heads/master@{#319200}
Diffstat (limited to 'remoting/webapp')
-rw-r--r-- | remoting/webapp/crd/js/log_to_server.js | 5 | ||||
-rw-r--r-- | remoting/webapp/crd/js/server_log_entry.js | 16 |
2 files changed, 11 insertions, 10 deletions
diff --git a/remoting/webapp/crd/js/log_to_server.js b/remoting/webapp/crd/js/log_to_server.js index d76b33f..fcd7e05 100644 --- a/remoting/webapp/crd/js/log_to_server.js +++ b/remoting/webapp/crd/js/log_to_server.js @@ -174,8 +174,9 @@ 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. - var elapsedTimeInMs = new Date().getTime() - this.sessionStartTime_; - entry.addElapsedTimeMs(elapsedTimeInMs); + var sessionDurationInSeconds = + (new Date().getTime() - this.sessionStartTime_) / 1000.0; + entry.addSessionDuration(sessionDurationInSeconds); // Send the stanza to the debug log. console.log('Enqueueing log entry:'); diff --git a/remoting/webapp/crd/js/server_log_entry.js b/remoting/webapp/crd/js/server_log_entry.js index 02e6feb..b7fdd3d 100644 --- a/remoting/webapp/crd/js/server_log_entry.js +++ b/remoting/webapp/crd/js/server_log_entry.js @@ -47,7 +47,7 @@ remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_TYPE_ = 'signal-strategy-type'; remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_ = 'signal-strategy-progress'; /** @private */ -remoting.ServerLogEntry.KEY_ELAPSED_TIME_MS_ = 'elapsed-time'; +remoting.ServerLogEntry.KEY_SESSION_DURATION_SECONDS_ = 'session-duration'; /** @@ -451,14 +451,14 @@ remoting.ServerLogEntry.extractHostDataFrom_ = function(s) { }; /** - * Adds a field to this log entry specifying the elapsed time since the start of - * the session to the current session state. - * @param {number} elapsedTimeInMs + * Adds a field to this log entry specifying the time in seconds since the start + * of the session to the current event. + * @param {number} sessionDurationInSeconds */ -remoting.ServerLogEntry.prototype.addElapsedTimeMs = - function(elapsedTimeInMs) { - this.set_(remoting.ServerLogEntry.KEY_ELAPSED_TIME_MS_, - String(elapsedTimeInMs)); +remoting.ServerLogEntry.prototype.addSessionDuration = + function(sessionDurationInSeconds) { + this.set_(remoting.ServerLogEntry.KEY_SESSION_DURATION_SECONDS_, + String(sessionDurationInSeconds)); }; |