| 1189 | } |
| 1190 | |
| 1191 | void RuntimeProfile::AddLocalTimeCounter(const SampleFunction& counter_fn) { |
| 1192 | DerivedCounter* local_time_counter = pool_->Add( |
| 1193 | new DerivedCounter(TUnit::TIME_NS, counter_fn)); |
| 1194 | lock_guard<SpinLock> l(counter_map_lock_); |
| 1195 | DCHECK(counter_map_.find(LOCAL_TIME_COUNTER_NAME) == counter_map_.end()) |
| 1196 | << "LocalTimeCounter already exists in the map."; |
| 1197 | counter_map_[LOCAL_TIME_COUNTER_NAME] = local_time_counter; |
| 1198 | } |
| 1199 | |
| 1200 | RuntimeProfileBase::Counter* RuntimeProfileBase::GetCounter(const string& name) const { |
| 1201 | lock_guard<SpinLock> l(counter_map_lock_); |