| 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)
|
| + );
|
| };
|
|
|