add RetryAttempts to AccessLog in JSON format
This commit is contained in:
parent
23cdb37165
commit
dae7e7a80a
11 changed files with 130 additions and 90 deletions
|
@ -1,6 +1,8 @@
|
|||
package middlewares
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/http/httptest"
|
||||
"reflect"
|
||||
"testing"
|
||||
|
||||
|
@ -8,10 +10,11 @@ import (
|
|||
)
|
||||
|
||||
func TestMetricsRetryListener(t *testing.T) {
|
||||
req := httptest.NewRequest(http.MethodGet, "/", nil)
|
||||
retryMetrics := newCollectingRetryMetrics()
|
||||
retryListener := NewMetricsRetryListener(retryMetrics, "backendName")
|
||||
retryListener.Retried(1)
|
||||
retryListener.Retried(2)
|
||||
retryListener.Retried(req, 1)
|
||||
retryListener.Retried(req, 2)
|
||||
|
||||
wantCounterValue := float64(2)
|
||||
if retryMetrics.retryCounter.counterValue != wantCounterValue {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue