MCPcopy Create free account
hub / github.com/apache/brpc / init_if_needed

Method init_if_needed

src/bthread/mutex.cpp:160–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

158}
159
160void ContentionProfiler::init_if_needed() {
161 if (!_init) {
162 // Already output nanoseconds, always set cycles/second to 1000000000.
163 _disk_buf.append("--- contention\ncycles/second=1000000000\n");
164 if (_dedup_map.init(1024, 60) != 0) {
165 LOG(WARNING) << "Fail to initialize dedup_map";
166 }
167 _init = true;
168 }
169}
170
171void ContentionProfiler::dump_and_destroy(SampledContention* c) {
172 init_if_needed();

Callers 1

ContentionProfilerStopFunction · 0.80

Calls 2

appendMethod · 0.45
initMethod · 0.45

Tested by

no test coverage detected