| 1157 | ADD_COUNTER_IMPL(AddConcurrentTimerCounter, ConcurrentTimerCounter); |
| 1158 | |
| 1159 | RuntimeProfile::DerivedCounter* RuntimeProfile::AddDerivedCounter( |
| 1160 | const string& name, TUnit::type unit, |
| 1161 | const SampleFunction& counter_fn, const string& parent_counter_name) { |
| 1162 | lock_guard<SpinLock> l(counter_map_lock_); |
| 1163 | if (counter_map_.find(name) != counter_map_.end()) return NULL; |
| 1164 | DerivedCounter* counter = pool_->Add(new DerivedCounter(unit, counter_fn)); |
| 1165 | counter_map_[name] = counter; |
| 1166 | set<string>* child_counters = |
| 1167 | FindOrInsert(&child_counter_map_, parent_counter_name, set<string>()); |
| 1168 | child_counters->insert(name); |
| 1169 | return counter; |
| 1170 | } |
| 1171 | |
| 1172 | RuntimeProfile::ThreadCounters* RuntimeProfile::AddThreadCounters( |
| 1173 | const string& prefix) { |