good morning!!!!

Skip to content
Snippets Groups Projects
Commit 7a860aee authored by Trevor Judice's avatar Trevor Judice
Browse files

tests

parent 1bba716d
No related branches found
No related tags found
No related merge requests found
......@@ -184,6 +184,7 @@ func (g *Gatling) handleConnection(ctx context.Context, c net.Conn) {
err := cl.Accept(ctx)
if err != nil {
metrics.RecordConnectionError(err)
if !errors.Is(err, io.EOF) {
log.Println("err in connection:", err.Error())
_ = cl.Send(pg_error.IntoPacket(err))
......
package metrics
import (
"log"
"github.com/prometheus/client_golang/prometheus"
"github.com/prometheus/client_golang/prometheus/promauto"
)
......@@ -61,8 +63,9 @@ func RecordConnectionError(err error) {
if !On() {
return
}
g := GatMetrics()
log.Println(err.Error())
if err != nil {
g := GatMetrics()
g.ConnectionErrorCounter.WithLabelValues(err.Error()).Inc()
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment