MCPcopy Create free account
hub / github.com/apache/impala / TrackersToPb

Method TrackersToPb

be/src/kudu/util/mem_tracker.cc:195–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

193}
194
195void MemTracker::TrackersToPb(MemTrackerPB* pb) {
196 CHECK(pb);
197 stack<std::pair<shared_ptr<MemTracker>, MemTrackerPB*>> to_process;
198 to_process.emplace(std::make_pair(GetRootTracker(), pb));
199 while (!to_process.empty()) {
200 auto tracker_and_pb = std::move(to_process.top());
201 to_process.pop();
202 auto& tracker = tracker_and_pb.first;
203 auto* tracker_pb = tracker_and_pb.second;
204 tracker_pb->set_id(tracker->id());
205 if (tracker->parent()) {
206 tracker_pb->set_parent_id(tracker->parent()->id());
207 }
208 tracker_pb->set_limit(tracker->limit());
209 tracker_pb->set_current_consumption(tracker->consumption());
210 tracker_pb->set_peak_consumption(tracker->peak_consumption());
211 {
212 MutexLock l(tracker->child_trackers_lock_);
213 for (const auto& child_weak : tracker->child_trackers_) {
214 shared_ptr<MemTracker> child = child_weak.lock();
215 if (child) {
216 auto* child_pb = tracker_pb->add_child_trackers();
217 to_process.emplace(std::make_pair(std::move(child), child_pb));
218 }
219 }
220 }
221 }
222}
223
224void MemTracker::Consume(int64_t bytes) {
225 if (bytes < 0) {

Callers

nothing calls this directly

Calls 9

moveFunction · 0.85
emptyMethod · 0.45
topMethod · 0.45
idMethod · 0.45
parentMethod · 0.45
limitMethod · 0.45
consumptionMethod · 0.45
peak_consumptionMethod · 0.45
lockMethod · 0.45

Tested by

no test coverage detected