refactor: simplify zrpc stat config (#3107)

This commit is contained in:
Kevin Wan
2023-04-08 22:45:05 +08:00
committed by GitHub
parent e13fd62d38
commit 98c9b5928a
6 changed files with 36 additions and 35 deletions

View File

@@ -1,8 +1,11 @@
package internal
import "time"
import "github.com/zeromicro/go-zero/zrpc/internal/serverinterceptors"
type (
// StatConf defines the stat config.
StatConf = serverinterceptors.StatConf
// ClientMiddlewaresConf defines whether to use client middlewares.
ClientMiddlewaresConf struct {
Trace bool `json:",default=true"`
@@ -14,12 +17,11 @@ type (
// ServerMiddlewaresConf defines whether to use server middlewares.
ServerMiddlewaresConf struct {
Trace bool `json:",default=true"`
Recover bool `json:",default=true"`
Stat bool `json:",default=true"`
StatSlowThreshold time.Duration `json:",default=500ms"`
NotLoggingContentMethods []string `json:",optional"`
Prometheus bool `json:",default=true"`
Breaker bool `json:",default=true"`
Trace bool `json:",default=true"`
Recover bool `json:",default=true"`
Stat bool `json:",default=true"`
StatConf StatConf `json:",optional"`
Prometheus bool `json:",default=true"`
Breaker bool `json:",default=true"`
}
)