Merge branch v2.10 into v3.0
This commit is contained in:
commit
7875826bd9
387 changed files with 19080 additions and 976 deletions
|
@ -3,8 +3,8 @@ package buffering
|
|||
import (
|
||||
"bytes"
|
||||
"context"
|
||||
"crypto/rand"
|
||||
"math"
|
||||
"math/rand"
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"testing"
|
||||
|
@ -16,7 +16,7 @@ import (
|
|||
|
||||
func TestBuffering(t *testing.T) {
|
||||
payload := make([]byte, math.MaxInt8)
|
||||
rand.Read(payload)
|
||||
_, _ = rand.Read(payload)
|
||||
|
||||
testCases := []struct {
|
||||
desc string
|
||||
|
|
|
@ -33,7 +33,7 @@ const (
|
|||
|
||||
type metricsMiddleware struct {
|
||||
next http.Handler
|
||||
reqsCounter gokitmetrics.Counter
|
||||
reqsCounter metrics.CounterWithHeaders
|
||||
reqsTLSCounter gokitmetrics.Counter
|
||||
reqDurationHistogram metrics.ScalableHistogram
|
||||
reqsBytesCounter gokitmetrics.Counter
|
||||
|
@ -145,7 +145,7 @@ func (m *metricsMiddleware) ServeHTTP(rw http.ResponseWriter, req *http.Request)
|
|||
|
||||
labels = append(labels, "code", strconv.Itoa(code))
|
||||
m.reqDurationHistogram.With(labels...).ObserveFromStart(start)
|
||||
m.reqsCounter.With(labels...).Add(1)
|
||||
m.reqsCounter.With(req.Header, labels...).Add(1)
|
||||
m.respsBytesCounter.With(labels...).Add(float64(capt.ResponseSize()))
|
||||
m.reqsBytesCounter.With(labels...).Add(float64(capt.RequestSize()))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue