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:
Kevin Wan
2021-11-01 15:04:38 +08:00
committed by GitHub
parent ebc90720ea
commit ba43214dae
9 changed files with 50 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ import (
"github.com/tal-tech/go-zero/core/discov"
"github.com/tal-tech/go-zero/zrpc/internal"
"github.com/tal-tech/go-zero/zrpc/internal/auth"
"github.com/tal-tech/go-zero/zrpc/internal/clientinterceptors"
"google.golang.org/grpc"
)
@@ -101,3 +102,8 @@ func NewClientWithTarget(target string, opts ...ClientOption) (Client, error) {
func (rc *RpcClient) Conn() *grpc.ClientConn {
return rc.client.Conn()
}
// SetClientSlowThreshold sets the slow threshold on client side.
func SetClientSlowThreshold(threshold time.Duration) {
clientinterceptors.SetSlowThreshold(threshold)
}