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

Unified Diff: remoting/webapp/crd/js/server_log_entry.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: Rename constant to include time unit, and remove superfluous constant. 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
Index: remoting/webapp/crd/js/server_log_entry.js
diff --git a/remoting/webapp/crd/js/server_log_entry.js b/remoting/webapp/crd/js/server_log_entry.js
index 7d848aa5b5a4a089f8909778f7108508fd933a75..f8aed71abd3875935f8be230845adbdce5fe6e3a 100644
--- a/remoting/webapp/crd/js/server_log_entry.js
+++ b/remoting/webapp/crd/js/server_log_entry.js
@@ -49,6 +49,11 @@ remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_PROGRESS_ =
/** @private */
remoting.ServerLogEntry.KEY_SIGNAL_STRATEGY_ELAPSED_TIME_ =
'signal-strategy-elapsed-time';
+/** @private */
+remoting.ServerLogEntry.EVENT_TOTAL_TIME_FOR_INITIAL_CONNECT_MS_ =
+ 'total-time-for-initial-connect';
Jamie 2015/02/25 21:12:35 I don't think we should need a separate log entry
anandc 2015/02/26 20:21:49 Done.
+
+
/**
* @private
@@ -315,6 +320,31 @@ remoting.ServerLogEntry.prototype.addStatsField_ = function(
return (val != 0);
};
+
+/**
+ * Makes a log entry for a "total connection time" event.
+ *
+ * @param {string} sessionId
+ * @param {remoting.DesktopConnectedView.Mode} mode
+ * @param {number} connectionTimeInMs
+ * @return {remoting.ServerLogEntry}
+ */
+remoting.ServerLogEntry.makeTotalTimeForInitialConnection =
+ function(sessionId, mode, connectionTimeInMs) {
+ var entry = new remoting.ServerLogEntry();
+ entry.set_(remoting.ServerLogEntry.KEY_ROLE_,
+ remoting.ServerLogEntry.VALUE_ROLE_CLIENT_);
+ entry.set_(
+ remoting.ServerLogEntry.KEY_EVENT_NAME_,
+ remoting.ServerLogEntry.EVENT_TOTAL_TIME_FOR_INITIAL_CONNECT_MS_);
+ entry.set_(remoting.ServerLogEntry.EVENT_TOTAL_TIME_FOR_INITIAL_CONNECT_MS_,
+ String(connectionTimeInMs));
+ entry.addSessionIdField(sessionId);
+ entry.addModeField(mode);
+ return entry;
+};
+
+
/**
* Makes a log entry for a "this session ID is old" event.
*
« remoting/webapp/crd/js/log_to_server.js ('K') | « remoting/webapp/crd/js/log_to_server.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698