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

Method qps

src/bvar/latency_recorder.cpp:181–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

179}
180
181int64_t LatencyRecorder::qps(time_t window_size) const {
182 detail::Sample<Stat> s;
183 _latency_window.get_span(window_size, &s);
184 // Use floating point to avoid overflow.
185 if (s.time_us <= 0) {
186 return 0;
187 }
188 return detail::double_to_random_int(s.data.num * 1000000.0 / s.time_us);
189}
190
191int LatencyRecorder::expose(const butil::StringPiece& prefix1,
192 const butil::StringPiece& prefix2) {

Callers 15

mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45
mainFunction · 0.45

Calls 2

double_to_random_intFunction · 0.85
get_spanMethod · 0.80

Tested by 2

TEST_FFunction · 0.36
TESTFunction · 0.36