Remove InfluxDB v1 metrics middleware

This commit is contained in:
Tom Moulard 2022-12-19 14:32:04 +01:00 committed by GitHub
parent 2b67f1f66f
commit 943238faba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 55 additions and 959 deletions

View file

@ -6,6 +6,7 @@ import (
"io"
"net/http"
"net/http/httptest"
"regexp"
"strconv"
"testing"
"time"
@ -155,3 +156,14 @@ func TestInfluxDB2(t *testing.T) {
assertMessage(t, *msgServiceOpenConns, expectedServiceOpenConns)
}
func assertMessage(t *testing.T, msg string, patterns []string) {
t.Helper()
for _, pattern := range patterns {
re := regexp.MustCompile(pattern)
match := re.FindStringSubmatch(msg)
if len(match) != 2 {
t.Errorf("Got %q %v, want %q", msg, match, pattern)
}
}
}