OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 * Different data types that each require their own labelled axis. | 6 * Different data types that each require their own labelled axis. |
7 */ | 7 */ |
8 var TimelineDataType = { | 8 var TimelineDataType = { |
9 SOURCE_COUNT: 0, | 9 SOURCE_COUNT: 0, |
10 BYTES_PER_SECOND: 1 | 10 BYTES_PER_SECOND: 1 |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 SourceCountDataSeries.prototype = { | 161 SourceCountDataSeries.prototype = { |
162 // Inherit the superclass's methods. | 162 // Inherit the superclass's methods. |
163 __proto__: superClass.prototype, | 163 __proto__: superClass.prototype, |
164 | 164 |
165 onReceivedLogEntry: function(entry) { | 165 onReceivedLogEntry: function(entry) { |
166 if (entry.source.type != this.sourceType_ || | 166 if (entry.source.type != this.sourceType_ || |
167 entry.type != this.eventType_) { | 167 entry.type != this.eventType_) { |
168 return; | 168 return; |
169 } | 169 } |
170 | 170 |
171 if (entry.phase == LogEventPhase.PHASE_BEGIN) { | 171 if (entry.phase == EventPhase.PHASE_BEGIN) { |
172 this.onBeginEvent(entry.source.id, entry.time); | 172 this.onBeginEvent(entry.source.id, entry.time); |
173 return; | 173 return; |
174 } | 174 } |
175 if (entry.phase == LogEventPhase.PHASE_END) | 175 if (entry.phase == EventPhase.PHASE_END) |
176 this.onEndEvent(entry.source.id, entry.time); | 176 this.onEndEvent(entry.source.id, entry.time); |
177 }, | 177 }, |
178 | 178 |
179 /** | 179 /** |
180 * Called when the source with the specified id begins doing whatever we | 180 * Called when the source with the specified id begins doing whatever we |
181 * care about. If it's not already an active source, we add it to the map | 181 * care about. If it's not already an active source, we add it to the map |
182 * and add a data point. | 182 * and add a data point. |
183 */ | 183 */ |
184 onBeginEvent: function(id, time) { | 184 onBeginEvent: function(id, time) { |
185 if (this.activeSources_[id]) | 185 if (this.activeSources_[id]) |
(...skipping 26 matching lines...) Expand all Loading... |
212 */ | 212 */ |
213 var SocketsInUseDataSeries = (function() { | 213 var SocketsInUseDataSeries = (function() { |
214 'use strict'; | 214 'use strict'; |
215 | 215 |
216 var superClass = SourceCountDataSeries; | 216 var superClass = SourceCountDataSeries; |
217 | 217 |
218 /** | 218 /** |
219 * @constructor | 219 * @constructor |
220 */ | 220 */ |
221 function SocketsInUseDataSeries() { | 221 function SocketsInUseDataSeries() { |
222 superClass.call(this, LogSourceType.SOCKET, LogEventType.SOCKET_IN_USE); | 222 superClass.call(this, EventSourceType.SOCKET, EventType.SOCKET_IN_USE); |
223 } | 223 } |
224 | 224 |
225 SocketsInUseDataSeries.prototype = { | 225 SocketsInUseDataSeries.prototype = { |
226 // Inherit the superclass's methods. | 226 // Inherit the superclass's methods. |
227 __proto__: superClass.prototype, | 227 __proto__: superClass.prototype, |
228 | 228 |
229 onReceivedLogEntry: function(entry) { | 229 onReceivedLogEntry: function(entry) { |
230 // SSL sockets have two nested SOCKET_IN_USE events. This is needed to | 230 // SSL sockets have two nested SOCKET_IN_USE events. This is needed to |
231 // mark SSL sockets as unused after SSL negotiation. | 231 // mark SSL sockets as unused after SSL negotiation. |
232 if (entry.type == LogEventType.SSL_CONNECT && | 232 if (entry.type == EventType.SSL_CONNECT && |
233 entry.phase == LogEventPhase.PHASE_END) { | 233 entry.phase == EventPhase.PHASE_END) { |
234 this.onEndEvent(entry.source.id, entry.time); | 234 this.onEndEvent(entry.source.id, entry.time); |
235 return; | 235 return; |
236 } | 236 } |
237 superClass.prototype.onReceivedLogEntry.call(this, entry); | 237 superClass.prototype.onReceivedLogEntry.call(this, entry); |
238 } | 238 } |
239 }; | 239 }; |
240 | 240 |
241 return SocketsInUseDataSeries; | 241 return SocketsInUseDataSeries; |
242 })(); | 242 })(); |
243 | 243 |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
345 function DiskCacheTransferRateDataSeries(eventType) { | 345 function DiskCacheTransferRateDataSeries(eventType) { |
346 superClass.call(this); | 346 superClass.call(this); |
347 this.eventType_ = eventType; | 347 this.eventType_ = eventType; |
348 } | 348 } |
349 | 349 |
350 DiskCacheTransferRateDataSeries.prototype = { | 350 DiskCacheTransferRateDataSeries.prototype = { |
351 // Inherit the superclass's methods. | 351 // Inherit the superclass's methods. |
352 __proto__: superClass.prototype, | 352 __proto__: superClass.prototype, |
353 | 353 |
354 onReceivedLogEntry: function(entry) { | 354 onReceivedLogEntry: function(entry) { |
355 if (entry.source.type != LogSourceType.DISK_CACHE_ENTRY || | 355 if (entry.source.type != EventSourceType.DISK_CACHE_ENTRY || |
356 entry.type != this.eventType_ || | 356 entry.type != this.eventType_ || |
357 entry.phase != LogEventPhase.PHASE_END) { | 357 entry.phase != EventPhase.PHASE_END) { |
358 return; | 358 return; |
359 } | 359 } |
360 // The disk cache has a lot of 0-length writes, when truncating entries. | 360 // The disk cache has a lot of 0-length writes, when truncating entries. |
361 // Ignore those. | 361 // Ignore those. |
362 if (entry.params.bytes_copied != 0) | 362 if (entry.params.bytes_copied != 0) |
363 this.addPoint(entry.time, entry.params.bytes_copied); | 363 this.addPoint(entry.time, entry.params.bytes_copied); |
364 } | 364 } |
365 }; | 365 }; |
366 | 366 |
367 return DiskCacheTransferRateDataSeries; | 367 return DiskCacheTransferRateDataSeries; |
368 })(); | 368 })(); |
OLD | NEW |