1
0
Fork 0

Pilot metrics provider

Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
This commit is contained in:
Romain 2020-08-10 15:26:04 +02:00 committed by GitHub
parent 5b05c990b0
commit 0d5d14d41a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 712 additions and 27 deletions

View file

@ -10,6 +10,7 @@ import (
"time"
"github.com/containous/traefik/v2/pkg/config/runtime"
"github.com/containous/traefik/v2/pkg/metrics"
"github.com/containous/traefik/v2/pkg/safe"
"github.com/stretchr/testify/require"
)
@ -43,7 +44,7 @@ func TestTick(t *testing.T) {
receivedConfig <- true
})
pilot := New("token", safe.NewPool(context.Background()))
pilot := New("token", metrics.RegisterPilot(), safe.NewPool(context.Background()))
pilot.client.baseURL = server.URL
ctx, cancel := context.WithCancel(context.Background())
@ -118,6 +119,6 @@ func TestClient_SendConfiguration(t *testing.T) {
token: myToken,
}
err := client.SendData(context.Background(), RunTimeRepresentation{})
err := client.SendData(context.Background(), RunTimeRepresentation{}, []metrics.PilotMetric{})
require.NoError(t, err)
}