| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <include src="stats_graph_helper.js"/> | 5 <include src="stats_graph_helper.js"/> |
| 6 | 6 |
| 7 var peerConnectionsListElem = null; | 7 var peerConnectionsListElem = null; |
| 8 | 8 |
| 9 function initialize() { | 9 function initialize() { |
| 10 peerConnectionsListElem = $('peer-connections-list'); | 10 peerConnectionsListElem = $('peer-connections-list'); |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 | 182 |
| 183 var log = data[i].log; | 183 var log = data[i].log; |
| 184 for (var j = 0; j < log.length; ++j) { | 184 for (var j = 0; j < log.length; ++j) { |
| 185 addToPeerConnectionLog(logElement, log[j]); | 185 addToPeerConnectionLog(logElement, log[j]); |
| 186 } | 186 } |
| 187 } | 187 } |
| 188 } | 188 } |
| 189 | 189 |
| 190 // data = {pid:|integer|, lid:|integer|, reports:|array|}. | 190 // data = {pid:|integer|, lid:|integer|, reports:|array|}. |
| 191 // Each entry of reports = | 191 // Each entry of reports = |
| 192 // {id:|string|, type:|string|, local:|object|, remote:|object|}. | 192 // {id:|string|, type:|string|, stats:|object|}, |
| 193 // reports.local or reports.remote = | 193 // where |stats| = {timestamp: |double|, values: |array|}, |
| 194 // {timestamp: |double|, values: |array|}, | 194 // where |values| is an array of strings, whose even index entry represents |
| 195 // where values is an array of strings, whose even index entry represents | |
| 196 // the name of the stat, and the odd index entry represents the value of | 195 // the name of the stat, and the odd index entry represents the value of |
| 197 // the stat. | 196 // the stat. |
| 198 function addStats(data) { | 197 function addStats(data) { |
| 199 var peerConnectionElement = ensurePeerConnectionElement( | 198 var peerConnectionElement = ensurePeerConnectionElement( |
| 200 getPeerConnectionId(data)); | 199 getPeerConnectionId(data)); |
| 201 for (var i = 0; i < data.reports.length; ++i) { | 200 for (var i = 0; i < data.reports.length; ++i) { |
| 202 var report = data.reports[i]; | 201 var report = data.reports[i]; |
| 203 var reportName = report.type + '-' + report.id; | 202 var reportName = report.type + '-' + report.id; |
| 204 var statsTable = ensureStatsTable(peerConnectionElement, reportName); | 203 var statsTable = ensureStatsTable(peerConnectionElement, reportName); |
| 205 | 204 |
| 206 addSingleReportToTable(statsTable, report.local); | 205 addSingleReportToTable(statsTable, report.stats); |
| 207 drawSingleReport(peerConnectionElement, reportName, report.local); | 206 drawSingleReport(peerConnectionElement, reportName, report.stats); |
| 208 addSingleReportToTable(statsTable, report.remote); | |
| 209 drawSingleReport(peerConnectionElement, reportName, report.remote); | |
| 210 } | 207 } |
| 211 } | 208 } |
| 212 | 209 |
| 213 document.addEventListener('DOMContentLoaded', initialize); | 210 document.addEventListener('DOMContentLoaded', initialize); |
| OLD | NEW |