diff options
author | jiayl@chromium.org <jiayl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 00:03:03 +0000 |
---|---|---|
committer | jiayl@chromium.org <jiayl@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 00:03:03 +0000 |
commit | 3e7fd92ef636a5cc073dbb8b20ce64b6bb28d0fb (patch) | |
tree | a73a69e5467987900ed533c9792e98b1ff3aa3a8 /content/browser/resources | |
parent | b7d7bffedc799caa6e40117cb20051d8db440f8d (diff) | |
download | chromium_src-3e7fd92ef636a5cc073dbb8b20ce64b6bb28d0fb.zip chromium_src-3e7fd92ef636a5cc073dbb8b20ce64b6bb28d0fb.tar.gz chromium_src-3e7fd92ef636a5cc073dbb8b20ce64b6bb28d0fb.tar.bz2 |
Fixes the issue in stats graph to not abort when a non-numerical value is seen.
Also makes the UI show report.id instead of report.type+report.id now that the id for stat objects are unique.
BUG=https://code.google.com/p/webrtc/issues/detail?id=1767
Review URL: https://chromiumcodereview.appspot.com/15035008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200113 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/resources')
-rw-r--r-- | content/browser/resources/media/stats_graph_helper.js | 23 | ||||
-rw-r--r-- | content/browser/resources/media/stats_table.js | 6 |
2 files changed, 18 insertions, 11 deletions
diff --git a/content/browser/resources/media/stats_graph_helper.js b/content/browser/resources/media/stats_graph_helper.js index 63ccf4d..7c89554 100644 --- a/content/browser/resources/media/stats_graph_helper.js +++ b/content/browser/resources/media/stats_graph_helper.js @@ -79,6 +79,14 @@ var dataConversionConfig = { } }; + +// The object contains the stats names that should not be added to the graph, +// even if they are numbers. +var statsNameBlackList = { + 'ssrc': true, + 'googTrackId': true, +}; + var graphViews = {}; var dataSeries = {}; @@ -91,15 +99,16 @@ function drawSingleReport(peerConnectionElement, report) { if (!stats || !stats.values) return; - var reportName = reportType + '-' + reportId; for (var i = 0; i < stats.values.length - 1; i = i + 2) { var rawLabel = stats.values[i]; - var rawValue = parseInt(stats.values[i + 1]); + if (statsNameBlackList[rawLabel]) + continue; + var rawValue = parseFloat(stats.values[i + 1]); if (isNaN(rawValue)) - return; + continue; var rawDataSeriesId = - peerConnectionElement.id + '-' + reportName + '-' + rawLabel; + peerConnectionElement.id + '-' + reportId + '-' + rawLabel; var finalDataSeriesId = rawDataSeriesId; var finalLabel = rawLabel; @@ -116,7 +125,7 @@ function drawSingleReport(peerConnectionElement, report) { dataSeries[rawDataSeriesId]); finalLabel = dataConversionConfig[rawLabel].convertedName; finalDataSeriesId = - peerConnectionElement.id + '-' + reportName + '-' + finalLabel; + peerConnectionElement.id + '-' + reportId + '-' + finalLabel; } // Updates the final dataSeries to draw. @@ -127,7 +136,7 @@ function drawSingleReport(peerConnectionElement, report) { var graphType = bweCompoundGraphConfig[finalLabel] ? 'bweCompound' : finalLabel; var graphViewId = - peerConnectionElement.id + '-' + reportName + '-' + graphType; + peerConnectionElement.id + '-' + reportId + '-' + graphType; if (!graphViews[graphViewId]) { graphViews[graphViewId] = createStatsGraphView(peerConnectionElement, @@ -174,7 +183,7 @@ function ensureStatsGraphTopContainer(peerConnectionElement, report) { container.firstChild.firstChild.className = STATS_GRAPH_CONTAINER_HEADING_CLASS; container.firstChild.firstChild.textContent = - 'Stats graphs for ' + report.type + '-' + report.id; + 'Stats graphs for ' + report.id; if (report.type == 'ssrc') { var ssrcInfoElement = document.createElement('div'); diff --git a/content/browser/resources/media/stats_table.js b/content/browser/resources/media/stats_table.js index c72af11..6b3ae52 100644 --- a/content/browser/resources/media/stats_table.js +++ b/content/browser/resources/media/stats_table.js @@ -74,8 +74,7 @@ var StatsTable = (function(ssrcInfoManager) { * @private */ ensureStatsTable_: function(peerConnectionElement, report) { - var tableId = peerConnectionElement.id + '-table-' + - report.type + '-' + report.id; + var tableId = peerConnectionElement.id + '-table-' + report.id; var table = $(tableId); if (!table) { var container = this.ensureStatsTableContainer_(peerConnectionElement); @@ -85,8 +84,7 @@ var StatsTable = (function(ssrcInfoManager) { table.border = 1; table.innerHTML = '<tr><th colspan=2></th></tr>'; - table.rows[0].cells[0].textContent = - 'Statistics ' + report.type + '-' + report.id; + table.rows[0].cells[0].textContent = 'Statistics ' + report.id; if (report.type == 'ssrc') { table.insertRow(1); table.rows[1].innerHTML = '<td colspan=2></td>'; |