Skip to content

Commit

Permalink
fix review issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mazhihui committed Sep 10, 2023
1 parent f19844d commit 169e5ae
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 3 additions & 5 deletions pixiu/pkg/filter/metric/metric.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ package metric

import (
"fmt"
http2 "net/http"
stdhttp "net/http"
"time"
)

Expand Down Expand Up @@ -141,12 +141,10 @@ func computeApproximateResponseSize(res *client.Response) (int, error) {
if res == nil {
return 0, errors.New("client.Response is null pointer ")
}
s := 0
s += len(res.Data)
return s, nil
return len(res.Data), nil
}

func computeApproximateRequestSize(r *http2.Request) (int, error) {
func computeApproximateRequestSize(r *stdhttp.Request) (int, error) {
if r == nil {
return 0, errors.New("http.Request is null pointer ")
}
Expand Down
4 changes: 1 addition & 3 deletions pixiu/pkg/prometheus/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,5 @@ func computeApproximateResponseSize(res *client.Response) (int, error) {
if res == nil {
return 0, errors.New("client.Response is null pointer ")
}
s := 0
s += len(res.Data)
return s, nil
return len(res.Data), nil
}

0 comments on commit 169e5ae

Please sign in to comment.