MCPcopy Index your code
hub / github.com/nodejs/node / Counter

Class Counter

deps/v8/tools/stats-viewer.py:330–356  ·  view source on GitHub ↗

A pointer to a single counter within a binary counters file.

Source from the content-addressed store, hash-verified

328
329
330class Counter(object):
331 """A pointer to a single counter within a binary counters file."""
332
333 def __init__(self, data, offset):
334 """Create a new instance.
335
336 Args:
337 data: the shared data access object containing the counter
338 offset: the byte offset of the start of this counter
339 """
340 self.data = data
341 self.offset = offset
342
343 def Value(self):
344 """Return the integer value of this counter."""
345 return self.data.IntAt(self.offset)
346
347 def Name(self):
348 """Return the ascii name of this counter."""
349 result = ""
350 index = self.offset + 4
351 current = self.data.ByteAt(index)
352 while current:
353 result += chr(current)
354 index += 1
355 current = self.data.ByteAt(index)
356 return result
357
358
359class CounterCollection(object):

Callers 1

CounterMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…