Skip to content

Commit

Permalink
Merge pull request #11862 from gyuho/const
Browse files Browse the repository at this point in the history
etcdserver: compute max request bytes humanized string once
  • Loading branch information
gyuho authored May 12, 2020
2 parents 5f07d46 + 89a3a24 commit ab49495
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions etcdserver/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ const (
)

var (
storeMemberAttributeRegexp = regexp.MustCompile(path.Join(membership.StoreMembersPrefix, "[[:xdigit:]]{1,16}", "attributes"))
recommendedMaxRequestBytesString = humanize.Bytes(uint64(recommendedMaxRequestBytes))
storeMemberAttributeRegexp = regexp.MustCompile(path.Join(membership.StoreMembersPrefix, "[[:xdigit:]]{1,16}", "attributes"))
)

func init() {
Expand Down Expand Up @@ -298,7 +299,7 @@ func NewServer(cfg ServerConfig) (srv *EtcdServer, err error) {
zap.Uint("max-request-bytes", cfg.MaxRequestBytes),
zap.String("max-request-size", humanize.Bytes(uint64(cfg.MaxRequestBytes))),
zap.Int("recommended-request-bytes", recommendedMaxRequestBytes),
zap.String("recommended-request-size", humanize.Bytes(uint64(recommendedMaxRequestBytes))),
zap.String("recommended-request-size", recommendedMaxRequestBytesString),
)
}

Expand Down

0 comments on commit ab49495

Please sign in to comment.