mirror of
https://github.com/openfaas/faas.git
synced 2025-06-08 16:26:47 +00:00
- 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>
22 lines
315 B
Go
22 lines
315 B
Go
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
|
|
})
|
|
}
|