Skip to content

Commit

Permalink
Log string, instead of float
Browse files Browse the repository at this point in the history
  • Loading branch information
KaloyanTanev committed Dec 12, 2024
1 parent 38fbd48 commit ffe90c1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions app/eth2wrap/eth2wrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,13 +177,13 @@ func latency(ctx context.Context, endpoint string, enableLogs bool) func() {
t0 := time.Now()

return func() {
rttSeconds := time.Since(t0).Seconds()
latencyHist.WithLabelValues(endpoint).Observe(rttSeconds)
rtt := time.Since(t0)
latencyHist.WithLabelValues(endpoint).Observe(rtt.Seconds())
if enableLogs {
log.Debug(ctx, "Beacon node call finished", z.Str("endpoint", endpoint))
// If BN call took more than 1 second, send WARN log
if rttSeconds > 1 {
log.Warn(ctx, "Beacon node call took longer than expected", nil, z.Str("endpoint", endpoint), z.F64("rtt_seconds", rttSeconds))
if rtt > time.Second {
log.Warn(ctx, "Beacon node call took longer than expected", nil, z.Str("endpoint", endpoint), z.Str("rtt", rtt.String()))
}

Check warning on line 187 in app/eth2wrap/eth2wrap.go

View check run for this annotation

Codecov / codecov/patch

app/eth2wrap/eth2wrap.go#L183-L187

Added lines #L183 - L187 were not covered by tests
}
}
Expand Down

0 comments on commit ffe90c1

Please sign in to comment.