Skip to content

Commit

Permalink
[feat] latency scale factor (#2655)
Browse files Browse the repository at this point in the history
* [feat] latency scale factor

* [fix] fix build

* [feat] define gflags in latency_recorder.cpp

---------

Co-authored-by: lianxuechao <lianxuechao@bytedance.com>
  • Loading branch information
superhail and lianxuechao authored Jun 10, 2024
1 parent 02fd47c commit 556e56b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/bvar/latency_recorder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 556e56b

Please sign in to comment.