| 390 | } |
| 391 | |
| 392 | void MemTracker::GetTopNQueries( |
| 393 | priority_queue<pair<int64_t, string>, vector<pair<int64_t, string>>, |
| 394 | greater<pair<int64_t, string>>>& min_pq, |
| 395 | int limit) { |
| 396 | lock_guard<SpinLock> l(child_trackers_lock_); |
| 397 | for (MemTracker* tracker : child_trackers_) { |
| 398 | if (!tracker->is_query_mem_tracker_) { |
| 399 | tracker->GetTopNQueries(min_pq, limit); |
| 400 | } else { |
| 401 | min_pq.push(pair<int64_t, string>(tracker->consumption(), tracker->LogUsage(0))); |
| 402 | if (min_pq.size() > limit) min_pq.pop(); |
| 403 | } |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | // Update the memory consumption related fields in pool_stats. |
| 408 | void MemTracker::UpdatePoolStatsForMemoryConsumed( |
nothing calls this directly
no test coverage detected