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

Unified Diff: remoting/webapp/me2mom/client_session.js

Issue 8865005: The chromoting client logs connection statistics to the server. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review. Created 9 years 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/me2mom/client_screen.js ('k') | remoting/webapp/me2mom/debug_log.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/me2mom/client_session.js
diff --git a/remoting/webapp/me2mom/client_session.js b/remoting/webapp/me2mom/client_session.js
index e9ae4bf41de14e8a70ae16b6b2a0ceed98879119..464aa509d88e20995b1d6d6d96974072784c4d0c 100644
--- a/remoting/webapp/me2mom/client_session.js
+++ b/remoting/webapp/me2mom/client_session.js
@@ -68,6 +68,15 @@ remoting.ClientSession.ConnectionError = {
NETWORK_FAILURE: 4
};
+// Keys for connection statistics.
+remoting.ClientSession.STATS_KEY_VIDEO_BANDWIDTH = 'video_bandwidth';
+remoting.ClientSession.STATS_KEY_VIDEO_FRAME_RATE = 'video_frame_rate';
+remoting.ClientSession.STATS_KEY_CAPTURE_LATENCY = 'capture_latency';
+remoting.ClientSession.STATS_KEY_ENCODE_LATENCY = 'encode_latency';
+remoting.ClientSession.STATS_KEY_DECODE_LATENCY = 'decode_latency';
+remoting.ClientSession.STATS_KEY_RENDER_LATENCY = 'render_latency';
+remoting.ClientSession.STATS_KEY_ROUNDTRIP_LATENCY = 'roundtrip_latency';
+
/**
* The current state of the session.
* @type {remoting.ClientSession.State}
@@ -413,13 +422,29 @@ remoting.ClientSession.prototype.updateDimensions = function() {
* @return {Object.<string, number>} The connection statistics.
*/
remoting.ClientSession.prototype.stats = function() {
- return {
- 'video_bandwidth': this.plugin.videoBandwidth,
- 'video_frame_rate': this.plugin.videoFrameRate,
- 'capture_latency': this.plugin.videoCaptureLatency,
- 'encode_latency': this.plugin.videoEncodeLatency,
- 'decode_latency': this.plugin.videoDecodeLatency,
- 'render_latency': this.plugin.videoRenderLatency,
- 'roundtrip_latency': this.plugin.roundTripLatency
- };
+ var dict = {};
+ dict[remoting.ClientSession.STATS_KEY_VIDEO_BANDWIDTH] =
+ this.plugin.videoBandwidth;
+ dict[remoting.ClientSession.STATS_KEY_VIDEO_FRAME_RATE] =
+ this.plugin.videoFrameRate;
+ dict[remoting.ClientSession.STATS_KEY_CAPTURE_LATENCY] =
+ this.plugin.videoCaptureLatency;
+ dict[remoting.ClientSession.STATS_KEY_ENCODE_LATENCY] =
+ this.plugin.videoEncodeLatency;
+ dict[remoting.ClientSession.STATS_KEY_DECODE_LATENCY] =
+ this.plugin.videoDecodeLatency;
+ dict[remoting.ClientSession.STATS_KEY_RENDER_LATENCY] =
+ this.plugin.videoRenderLatency;
+ dict[remoting.ClientSession.STATS_KEY_ROUNDTRIP_LATENCY] =
+ this.plugin.roundTripLatency;
+ return dict;
+};
+
+/**
+ * Logs statistics.
+ *
+ * @param {Object.<string, number>} stats
+ */
+remoting.ClientSession.prototype.logStatistics = function(stats) {
+ this.logToServer.logStatistics(stats);
};
« no previous file with comments | « remoting/webapp/me2mom/client_screen.js ('k') | remoting/webapp/me2mom/debug_log.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698