1
0
Fork 0

Added RetryMetrics to DataDog and StatsD providers

This commit is contained in:
Alex Antonov 2017-08-08 19:54:35 -05:00 committed by Ludovic Fernandez
parent 990ee89650
commit 6b133e24b9
5 changed files with 19 additions and 6 deletions

View file

@ -40,10 +40,16 @@ func TestDatadog(t *testing.T) {
req1 := testhelpers.MustNewRequest(http.MethodGet, "http://localhost:3000/ok", nil)
req2 := testhelpers.MustNewRequest(http.MethodGet, "http://localhost:3000/not-found", nil)
retryListener := NewMetricsRetryListener(dd)
retryListener.Retried(1)
retryListener.Retried(2)
expected := []string{
// We are only validating counts, as it is nearly impossible to validate latency, since it varies every run
"traefik.requests.total:1.000000|c|#service:test,code:404,method:GET\n",
"traefik.requests.total:1.000000|c|#service:test,code:200,method:GET\n",
"traefik.backend.retries.total:2.000000|c|#service:test\n",
"traefik.request.duration",
}
udp.ShouldReceiveAll(t, expected, func() {