1
0
Fork 0

Merge current branch v2.4 into master

This commit is contained in:
Jean-Baptiste Doumenjou 2021-03-09 11:32:01 +01:00
commit 702e301990
100 changed files with 561 additions and 557 deletions

View file

@ -3,7 +3,7 @@ package metrics
import (
"context"
"fmt"
"io/ioutil"
"io"
"net/http"
"net/http/httptest"
"regexp"
@ -79,7 +79,7 @@ func TestInfluxDB(t *testing.T) {
func TestInfluxDBHTTP(t *testing.T) {
c := make(chan *string)
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
body, err := ioutil.ReadAll(r.Body)
body, err := io.ReadAll(r.Body)
if err != nil {
http.Error(w, "can't read body "+err.Error(), http.StatusBadRequest)
return

View file

@ -30,7 +30,7 @@ func TestScalableHistogram(t *testing.T) {
measuredDuration, err := time.ParseDuration(extractedDurationString[0] + "ms")
assert.NoError(t, err)
assert.InDelta(t, 500*time.Millisecond, measuredDuration, float64(1*time.Millisecond))
assert.InDelta(t, 500*time.Millisecond, measuredDuration, float64(15*time.Millisecond))
}
func TestNewMultiRegistry(t *testing.T) {

View file

@ -402,7 +402,7 @@ func newCollector(metricName string, labels stdprometheus.Labels, c stdprometheu
// collector wraps a Collector object from the Prometheus client library.
// It adds information on how many generations this metric should be present
// in the /metrics output, relatived to the time it was last tracked.
// in the /metrics output, relative to the time it was last tracked.
type collector struct {
id string
labels stdprometheus.Labels