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

Unified Diff: remoting/webapp/crd/js/log_to_server.js

Issue 953223002: Include time elapsed since start of a remoting session in each log entry. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Record elapsed time every time we log something. Created 5 years, 10 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
« no previous file with comments | « remoting/webapp/crd/js/fallback_signal_strategy.js ('k') | remoting/webapp/crd/js/server_log_entry.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/crd/js/log_to_server.js
diff --git a/remoting/webapp/crd/js/log_to_server.js b/remoting/webapp/crd/js/log_to_server.js
index 8b87f1b5c4efc7273b3cb4ce5f43f36ae5926294..c446ec3b09ed9bea462aa6b6a469cda300d3cc92 100644
--- a/remoting/webapp/crd/js/log_to_server.js
+++ b/remoting/webapp/crd/js/log_to_server.js
@@ -78,10 +78,8 @@ remoting.LogToServer.prototype.logClientSessionStateChange =
(this.sessionStartTime_ != 0)) {
entry.addSessionDurationField(
(new Date().getTime() - this.sessionStartTime_) / 1000.0);
- if (remoting.LogToServer.isEndOfSession_(state)) {
- this.sessionStartTime_ = 0;
- }
}
+
this.log_(entry);
// Don't accumulate connection statistics across state changes.
this.logAccumulatedStatistics_();
@@ -90,6 +88,7 @@ remoting.LogToServer.prototype.logClientSessionStateChange =
if (remoting.LogToServer.isEndOfSession_(state)) {
this.clearSessionId_();
}
+
};
/**
@@ -104,13 +103,12 @@ remoting.LogToServer.prototype.setConnectionType = function(connectionType) {
/**
* @param {remoting.SignalStrategy.Type} strategyType
* @param {remoting.FallbackSignalStrategy.Progress} progress
- * @param {number} elapsedTimeInMs
*/
remoting.LogToServer.prototype.logSignalStrategyProgress =
- function(strategyType, progress, elapsedTimeInMs) {
+ function(strategyType, progress) {
this.maybeExpireSessionId_();
var entry = remoting.ServerLogEntry.makeSignalStrategyProgress(
- this.sessionId_, strategyType, progress, elapsedTimeInMs);
+ this.sessionId_, strategyType, progress);
this.log_(entry);
};
@@ -203,6 +201,10 @@ remoting.LogToServer.prototype.logAccumulatedStatistics_ = function() {
* @param {remoting.ServerLogEntry} entry
*/
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);
+
// Send the stanza to the debug log.
console.log('Enqueueing log entry:');
entry.toDebugLog(1);
« no previous file with comments | « remoting/webapp/crd/js/fallback_signal_strategy.js ('k') | remoting/webapp/crd/js/server_log_entry.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698