guodongxiaren opened a new issue #1225:
URL: https://github.com/apache/incubator-brpc/issues/1225
**Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)**
不用生产环境来dump流量。用的非生产环境,但是非生产环境的流量很小。想dump流量貌似很慢。
**Describe the solution you'd like (描述你期望的解决方法)**
调节一下随机策略。加一个控制因子
```c
inline size_t is_collectable(CollectorSpeedLimit* speed_limit) {
if (speed_limit->ever_grabbed) { // most common case
const size_t sampling_range = speed_limit->sampling_range;
// fast_rand is faster than fast_rand_in
if ((butil::fast_rand() & (COLLECTOR_SAMPLING_BASE - 1)) >=
sampling_range) {
return 0;
}
return sampling_range;
}
// Slower, only runs before -bvar_collector_expected_per_second samples
are
// collected to calculate a more reasonable sampling_range for the type.
extern size_t
is_collectable_before_first_time_grabbed(CollectorSpeedLimit*);
return is_collectable_before_first_time_grabbed(speed_limit);
}
```
这个sampling_range 能不能是通过控制因子计算的。
**Describe alternatives you've considered (描述你想到的折衷方案)**
**Additional context/screenshots (更多上下文/截图)**
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]