MCPcopy Create free account
hub / github.com/FDio/vpp / StatsHistogramLog2

Class StatsHistogramLog2

src/vpp-api/python/vpp_papi/vpp_stats.py:440–458  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

438
439# Add a helper class for histogram log2
440class StatsHistogramLog2:
441 def __init__(self, bins, min_exp):
442 self.bins = bins # list of lists: [thread][bin]
443 self.min_exp = min_exp
444
445 def sum(self):
446 return sum(sum(thread_bins) for thread_bins in self.bins)
447
448 def thread_count(self):
449 return len(self.bins)
450
451 def bin_count(self):
452 return max((len(b) for b in self.bins), default=0)
453
454 def __getitem__(self, idx):
455 return self.bins[idx]
456
457 def __repr__(self):
458 return f"StatsHistogramLog2(min_exp={self.min_exp}, bins={self.bins})"
459
460
461class StatsEntry:

Callers 1

histogram_log2Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected