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

Side by Side Diff: remoting/webapp/connection_stats.js

Issue 126123002: Show connection type in web-app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @fileoverview 6 * @fileoverview
7 * Module to support debug overlay window with connection stats. 7 * Module to support debug overlay window with connection stats.
8 */ 8 */
9 9
10 'use strict'; 10 'use strict';
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
56 */ 56 */
57 function formatStatNumber(value, units) { 57 function formatStatNumber(value, units) {
58 if (value != undefined) { 58 if (value != undefined) {
59 return value.toFixed(2) + ' ' + units; 59 return value.toFixed(2) + ' ' + units;
60 } else { 60 } else {
61 return "n/a"; 61 return "n/a";
62 } 62 }
63 } 63 }
64 64
65 var statistics = document.getElementById('statistics'); 65 var statistics = document.getElementById('statistics');
66 this.statsElement.innerText = ( 66 var statsString = (
67 'Bandwidth: ' + formatStatNumber(videoBandwidth, units) + 67 'Bandwidth: ' + formatStatNumber(videoBandwidth, units) +
68 ', Frame Rate: ' + formatStatNumber(stats.videoFrameRate, 'fps') + 68 ', Frame Rate: ' + formatStatNumber(stats.videoFrameRate, 'fps') +
69 ', Capture: ' + formatStatNumber(stats.captureLatency, 'ms') + 69 ', Capture: ' + formatStatNumber(stats.captureLatency, 'ms') +
70 ', Encode: ' + formatStatNumber(stats.encodeLatency, 'ms') + 70 ', Encode: ' + formatStatNumber(stats.encodeLatency, 'ms') +
71 ', Decode: ' + formatStatNumber(stats.decodeLatency, 'ms') + 71 ', Decode: ' + formatStatNumber(stats.decodeLatency, 'ms') +
72 ', Render: ' + formatStatNumber(stats.renderLatency, 'ms') + 72 ', Render: ' + formatStatNumber(stats.renderLatency, 'ms') +
73 ', Latency: ' + formatStatNumber(stats.roundtripLatency, 'ms')); 73 ', Latency: ' + formatStatNumber(stats.roundtripLatency, 'ms'));
74 var channelType = '';
75 var allChannelTypesMatch = true;
76 var channelTypesString = '';
77 for (var channel in stats.channelTypes) {
78 if (channelType == '') {
79 channelType = stats.channelTypes[channel];
80 } else if (stats.channelTypes[channel] != channelType) {
81 allChannelTypesMatch = false;
82 }
83 channelTypesString += ', ' + channel + ': ' + stats.channelTypes[channel];
84 }
85 if (allChannelTypesMatch) {
86 statsString += ', connection: ' + channelType;
87 } else {
88 statsString += channelTypesString;
89 }
90 this.statsElement.innerText = statsString;
74 }; 91 };
75 92
76 /** 93 /**
77 * Check for the debug toggle hot-key. 94 * Check for the debug toggle hot-key.
78 * 95 *
79 * @param {Event} event The keyboard event. 96 * @param {Event} event The keyboard event.
80 * @return {void} Nothing. 97 * @return {void} Nothing.
81 */ 98 */
82 remoting.ConnectionStats.onKeydown = function(event) { 99 remoting.ConnectionStats.onKeydown = function(event) {
83 var element = /** @type {Element} */ (event.target); 100 var element = /** @type {Element} */ (event.target);
84 if (element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') { 101 if (element.tagName == 'INPUT' || element.tagName == 'TEXTAREA') {
85 return; 102 return;
86 } 103 }
87 if (String.fromCharCode(event.which) == 'D') { 104 if (String.fromCharCode(event.which) == 'D') {
88 remoting.stats.toggle(); 105 remoting.stats.toggle();
89 } 106 }
90 }; 107 };
91 108
92 /** @type {remoting.ConnectionStats} */ 109 /** @type {remoting.ConnectionStats} */
93 remoting.stats = null; 110 remoting.stats = null;
OLDNEW
« remoting/webapp/client_plugin_async.js ('K') | « remoting/webapp/client_session.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698