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() { ...@@ -174,8 +174,9 @@ remoting.LogToServer.prototype.logAccumulatedStatistics_ = function() {
*/ */
remoting.LogToServer.prototype.log_ = function(entry) { remoting.LogToServer.prototype.log_ = function(entry) {
// Log the time taken to get to this point from the time this session started. // Log the time taken to get to this point from the time this session started.
var elapsedTimeInMs = new Date().getTime() - this.sessionStartTime_; var sessionDurationInSeconds =
entry.addElapsedTimeMs(elapsedTimeInMs); (new Date().getTime() - this.sessionStartTime_) / 1000.0;
entry.addSessionDuration(sessionDurationInSeconds);
// Send the stanza to the debug log. // Send the stanza to the debug log.
console.log('Enqueueing log entry:'); console.log('Enqueueing log entry:');
......
...@@ -47,7 +47,7 @@ remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_TYPE_ = 'signal-strategy-type'; ...@@ -47,7 +47,7 @@ remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_TYPE_ = 'signal-strategy-type';
remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_ = remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_ =
'signal-strategy-progress'; 'signal-strategy-progress';
/** @private */ /** @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) { ...@@ -451,14 +451,14 @@ remoting.ServerLogEntry.extractHostDataFrom_ = function(s) {
}; };
/** /**
* Adds a field to this log entry specifying the elapsed time since the start of * Adds a field to this log entry specifying the time in seconds since the start
* the session to the current session state. * of the session to the current event.
* @param {number} elapsedTimeInMs * @param {number} sessionDurationInSeconds
*/ */
remoting.ServerLogEntry.prototype.addElapsedTimeMs = remoting.ServerLogEntry.prototype.addSessionDuration =
function(elapsedTimeInMs) { function(sessionDurationInSeconds) {
this.set_(remoting.ServerLogEntry.KEY_ELAPSED_TIME_MS_, this.set_(remoting.ServerLogEntry.KEY_SESSION_DURATION_SECONDS_,
String(elapsedTimeInMs)); 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