Commit bd907bb6 authored by anandc's avatar anandc Committed by Commit bot

Rename elapsed-time field in Chromoting log events to session-duration, and...

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}
parent e73c0b43
......@@ -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:');
......
......@@ -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));
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment