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

Method histogram_log2

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

Histogram log2 counter (STAT_DIR_TYPE_HISTOGRAM_LOG2)

(self, stats)

Source from the content-addressed store, hash-verified

533 return StatsRingBuffer(stats, self.value)
534
535 def histogram_log2(self, stats):
536 """Histogram log2 counter (STAT_DIR_TYPE_HISTOGRAM_LOG2)"""
537 # The value is a pointer to a vector of pointers (per-thread), each pointing to a vector of uint64_t bins
538 threads_ptr = self.value
539 thread_vec = StatsVector(stats, threads_ptr, "P")
540 all_bins = []
541 min_exp = 0
542 for thread_ptr_tuple in thread_vec:
543 bins_ptr = thread_ptr_tuple[0]
544 if bins_ptr:
545 bins_vec = StatsVector(stats, bins_ptr, "Q")
546 bins = [v[0] for v in bins_vec]
547 if bins:
548 min_exp = bins[0]
549 all_bins.append(bins[1:])
550 else:
551 all_bins.append([])
552 else:
553 all_bins.append([])
554 return StatsHistogramLog2(all_bins, min_exp)
555
556 def get_counter(self, stats):
557 """Return a list of counters"""

Callers

nothing calls this directly

Calls 3

StatsVectorClass · 0.85
StatsHistogramLog2Class · 0.85
appendMethod · 0.80

Tested by

no test coverage detected