-
Notifications
You must be signed in to change notification settings - Fork 4.1k
rpc_dump的功能可以方便的自定义采样频率吗? #1225
Copy link
Copy link
Closed
Labels
usageuser need to change the way using brpc to solve the problemuser need to change the way using brpc to solve the problem
Description
Is your feature request related to a problem? (你需要的功能是否与某个问题有关?)
不用生产环境来dump流量。用的非生产环境,但是非生产环境的流量很小。想dump流量貌似很慢。
Describe the solution you'd like (描述你期望的解决方法)
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 受FLAGS_bvar_collector_expected_per_second影响。
但是计算方法太迷了。怎么设置才能让每个请求过来都能dump。
Describe alternatives you've considered (描述你想到的折衷方案)
Additional context/screenshots (更多上下文/截图)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
usageuser need to change the way using brpc to solve the problemuser need to change the way using brpc to solve the problem
Type
Fields
Give feedbackNo fields configured for issues without a type.