An overlay over a counters file that provides access to the individual counters contained in the file.
| 357 | |
| 358 | |
| 359 | class CounterCollection(object): |
| 360 | """An overlay over a counters file that provides access to the |
| 361 | individual counters contained in the file.""" |
| 362 | |
| 363 | def __init__(self, data): |
| 364 | """Create a new instance. |
| 365 | |
| 366 | Args: |
| 367 | data: the shared data access object |
| 368 | """ |
| 369 | self.data = data |
| 370 | self.max_counters = data.IntAt(4) |
| 371 | self.max_name_size = data.IntAt(8) |
| 372 | |
| 373 | def CountersInUse(self): |
| 374 | """Return the number of counters in active use.""" |
| 375 | return self.data.IntAt(12) |
| 376 | |
| 377 | def Counter(self, index): |
| 378 | """Return the index'th counter.""" |
| 379 | return Counter(self.data, 16 + index * self.CounterSize()) |
| 380 | |
| 381 | def CounterSize(self): |
| 382 | """Return the size of a single counter.""" |
| 383 | return 4 + self.max_name_size |
| 384 | |
| 385 | |
| 386 | class ChromeCounter(object): |
no outgoing calls
no test coverage detected
searching dependent graphs…