feat: slow threshold customizable in zrpc (#1191)
* feat: slow threshold customizable in rest * feat: slow threshold customizable in rest * feat: slow threshold customizable in rest * feat: slow threshold customizable in zrpc
This commit is contained in:
@@ -95,6 +95,11 @@ func (rs *RpcServer) Stop() {
|
||||
logx.Close()
|
||||
}
|
||||
|
||||
// SetServerSlowThreshold sets the slow threshold on server side.
|
||||
func SetServerSlowThreshold(threshold time.Duration) {
|
||||
serverinterceptors.SetSlowThreshold(threshold)
|
||||
}
|
||||
|
||||
func setupInterceptors(server internal.Server, c RpcServerConf, metrics *stat.Metrics) error {
|
||||
if c.CpuThreshold > 0 {
|
||||
shedder := load.NewAdaptiveShedder(load.WithCpuThreshold(c.CpuThreshold))
|
||||
|
||||
Reference in New Issue
Block a user