MCPcopy Create free account
hub / github.com/apache/trafficserver / dump

Method dump

plugins/experimental/rate_limit/ip_reputation.cc:297–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297void
298SieveLru::dump()
299{
300 TSMutexLock(_lock);
301 TSAssert(_initialized);
302
303 for (uint32_t i = 0; i < _num_buckets + 1; ++i) {
304 int64_t cnt = 0, sum = 0;
305 auto lru = _buckets[i];
306
307 std::cout << '\n' << "Dumping bucket " << i << " (size=" << lru->size() << ", max_size=" << lru->max_size() << ")" << '\n';
308 for (auto &it : *lru) {
309 auto &[key, count, bucket, added] = it;
310
311 ++cnt;
312 sum += count;
313#if 0
314 if (0 == i) { // Also dump the content of the top bucket
315 std::cout << "\t" << key << "; Count=" << count << ", Bucket=" << bucket << "\n";
316 }
317#endif
318 }
319
320 std::cout << "\tAverage count=" << (cnt > 0 ? sum / cnt : 0) << '\n';
321 }
322 TSMutexUnlock(_lock);
323}
324
325// Debugging tools, these memory sizes are best guesses to how much memory the containers will actually use
326size_t

Callers 1

write_sessionsFunction · 0.45

Calls 4

TSMutexLockFunction · 0.85
TSMutexUnlockFunction · 0.85
sizeMethod · 0.45
max_sizeMethod · 0.45

Tested by

no test coverage detected