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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user