| 91 | } |
| 92 | |
| 93 | RuntimeProfileBase::Counter* RuntimeProfile::AddSamplingCounter( |
| 94 | const string& name, Counter* src_counter) { |
| 95 | DCHECK(src_counter->unit() == TUnit::UNIT); |
| 96 | lock_guard<SpinLock> l(counter_map_lock_); |
| 97 | bool created; |
| 98 | Counter* dst_counter = |
| 99 | AddCounterLocked(name, TUnit::DOUBLE_VALUE, ROOT_COUNTER, &created); |
| 100 | if (!created) return dst_counter; |
| 101 | sampling_counters_.push_back(dst_counter); |
| 102 | PeriodicCounterUpdater::RegisterPeriodicCounter(src_counter, NULL, dst_counter, |
| 103 | PeriodicCounterUpdater::SAMPLING_COUNTER); |
| 104 | has_active_periodic_counters_ = true; |
| 105 | return dst_counter; |
| 106 | } |
| 107 | |
| 108 | RuntimeProfileBase::Counter* RuntimeProfile::AddSamplingCounter( |
| 109 | const string& name, SampleFunction sample_fn) { |
no test coverage detected