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

Unified Diff: remoting/webapp/base/js/connection_stats.js

Issue 1811833002: Show max latency on client's status bar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: JS compiler fix and lld fix Created 4 years, 9 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/base/js/chromoting_event.js ('k') | remoting/webapp/base/js/session_logger.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/webapp/base/js/connection_stats.js
diff --git a/remoting/webapp/base/js/connection_stats.js b/remoting/webapp/base/js/connection_stats.js
index d08a5270bd6c444f3e3601af572b7c83aac85210..61d5680c6d2748bb3c9d06e1254b438df4396a52 100644
--- a/remoting/webapp/base/js/connection_stats.js
+++ b/remoting/webapp/base/js/connection_stats.js
@@ -123,23 +123,36 @@ remoting.ConnectionStats.prototype.update = function(stats) {
/**
* @param {number} value
* @param {string} units
+ * @param {number} digits
* @return {string} Formatted number.
*/
- function formatStatNumber(value, units) {
+ function formatStatNumber(value, units, digits) {
if (value != undefined) {
- return value.toFixed(2) + ' ' + units;
+ return value.toFixed(digits) + ' ' + units;
} else {
return "n/a";
}
}
+ /**
+ * @param {string} type
+ * @param {number} avg
+ * @param {number} max
+ * @return {string} "type: avg, max; " e.g. "RTT: 8.0, 13; "
+ */
+ function formatStat(type, avg, max) {
+ return type + ': ' + avg.toFixed(1) + ', ' + max + '; ';
+ }
+
var statistics = document.getElementById('statistics');
this.statsElement_.innerText = (
- 'Bandwidth: ' + formatStatNumber(videoBandwidth, units) +
- ', Frame Rate: ' + formatStatNumber(stats.videoFrameRate, 'fps') +
- ', Capture: ' + formatStatNumber(stats.captureLatency, 'ms') +
- ', Encode: ' + formatStatNumber(stats.encodeLatency, 'ms') +
- ', Decode: ' + formatStatNumber(stats.decodeLatency, 'ms') +
- ', Render: ' + formatStatNumber(stats.renderLatency, 'ms') +
- ', Latency: ' + formatStatNumber(stats.roundtripLatency, 'ms'));
+ '(avg, max in ms) ' +
+ formatStat('Capture', stats.captureLatency, stats.maxCaptureLatency) +
+ formatStat('Encode', stats.encodeLatency, stats.maxEncodeLatency) +
+ formatStat('Decode', stats.decodeLatency, stats.maxDecodeLatency) +
+ formatStat('Render', stats.renderLatency, stats.maxRenderLatency) +
+ formatStat('RTT', stats.roundtripLatency, stats.maxRoundtripLatency) +
+ 'Bandwidth: ' + formatStatNumber(videoBandwidth, units, 2) + '; ' +
+ 'Frame Rate: ' + formatStatNumber(stats.videoFrameRate, 'fps', 1)
+ );
};
« no previous file with comments | « remoting/webapp/base/js/chromoting_event.js ('k') | remoting/webapp/base/js/session_logger.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698