Add RED metrics

- this PR adds metrics via Prometheus for instrumentation and
to move towards using HPAv2 / custom metrics in Kubernetes.

Signed-off-by: Alex Ellis <alexellis2@gmail.com>
This commit is contained in:
Alex Ellis
2019-04-03 22:03:44 +01:00
parent 1b61954ad9
commit 634ec22c8d
125 changed files with 33018 additions and 9 deletions

View File

@ -0,0 +1,21 @@
package metrics
import (
"testing"
"time"
)
func Test_RegisterServer(t *testing.T) {
metricsPort := 31111
metricsServer := MetricsServer{}
metricsServer.Register(metricsPort)
cancel := make(chan bool)
go metricsServer.Serve(cancel)
time.AfterFunc(time.Millisecond*500, func() {
cancel <- true
})
}