refactor: simplify zrpc stat config (#3107)
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user