This is an automated email from the ASF dual-hosted git repository.
wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 556e56b4 [feat] latency scale factor (#2655)
556e56b4 is described below
commit 556e56b409a19b272c2a11b037eb17be0cf461c9
Author: Alan Muhammad <[email protected]>
AuthorDate: Mon Jun 10 14:14:54 2024 +0800
[feat] latency scale factor (#2655)
* [feat] latency scale factor
* [fix] fix build
* [feat] define gflags in latency_recorder.cpp
---------
Co-authored-by: lianxuechao <[email protected]>
---
src/bvar/latency_recorder.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/bvar/latency_recorder.cpp b/src/bvar/latency_recorder.cpp
index c6532958..791bc626 100644
--- a/src/bvar/latency_recorder.cpp
+++ b/src/bvar/latency_recorder.cpp
@@ -280,7 +280,10 @@ void LatencyRecorder::hide() {
_latency_percentiles.hide();
}
+DEFINE_uint64(latency_scale_factor, 1, "latency scale factor, used by method
status, etc., latency_us = latency * latency_scale_factor");
+
LatencyRecorder& LatencyRecorder::operator<<(int64_t latency) {
+ latency = latency / FLAGS_latency_scale_factor;
_latency << latency;
_max_latency << latency;
_latency_percentile << latency;
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]