Skip to content

Commit

Permalink
SSV:Connections - do not write/log metric on cancellation contexts
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-ssvlabs committed Sep 3, 2024
1 parent c070339 commit 4613d32
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions internal/benchmark/metrics/ssv/connections.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ func (p *ConnectionsMetric) measure(ctx context.Context) {
}
res, err := http.DefaultClient.Do(req)
if err != nil {
p.AddDataPoint(map[string]uint32{
InboundConnectionsMeasurement: 0,
OutboundConnectionsMeasurement: 0,
})
logger.WriteError(metric.SSVGroup, p.Name, err)
if err != ctx.Err() {
p.AddDataPoint(map[string]uint32{
InboundConnectionsMeasurement: 0,
OutboundConnectionsMeasurement: 0,
})
logger.WriteError(metric.SSVGroup, p.Name, err)
}
return
}
defer res.Body.Close()
Expand Down

0 comments on commit 4613d32

Please sign in to comment.