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

Method InitCounters

be/src/runtime/bufferpool/reservation-tracker.cc:104–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

102}
103
104void ReservationTracker::InitCounters(
105 RuntimeProfile* profile, int64_t reservation_limit) {
106 if (profile == nullptr) {
107 dummy_profile_.reset(new DummyProfile);
108 profile = dummy_profile_->profile();
109 }
110
111 // Check that another tracker's counters aren't already registered in the profile.
112 DCHECK(profile->GetCounter("PeakReservation") == nullptr);
113 counters_.peak_reservation =
114 profile->AddHighWaterMarkCounter("PeakReservation", TUnit::BYTES);
115 counters_.peak_used_reservation =
116 profile->AddHighWaterMarkCounter("PeakUsedReservation", TUnit::BYTES);
117 // Only show the limit if set.
118 counters_.reservation_limit = nullptr;
119 if (reservation_limit != numeric_limits<int64_t>::max()) {
120 counters_.reservation_limit = ADD_COUNTER(profile, "ReservationLimit", TUnit::BYTES);
121 COUNTER_SET(counters_.reservation_limit, reservation_limit);
122 }
123 if (mem_tracker_ != nullptr) mem_tracker_->EnableReservationReporting(counters_);
124}
125
126void ReservationTracker::Close() {
127 lock_guard<SpinLock> l(lock_);

Callers

nothing calls this directly

Calls 5

maxFunction · 0.85
GetCounterMethod · 0.80
resetMethod · 0.65
profileMethod · 0.45

Tested by

no test coverage detected