Skip to content

Commit

Permalink
go/worker/compute/executor: Defer call to time.Since
Browse files Browse the repository at this point in the history
  • Loading branch information
peternose committed Nov 7, 2023
1 parent 3bae70e commit 62ebb4e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/worker/compute/executor/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,9 @@ func (n *Node) proposeBatch(
// Commit I/O and state write logs to storage.
storageErr := func() error {
start := time.Now()
defer storageCommitLatency.With(n.getMetricLabels()).Observe(time.Since(start).Seconds())
defer func() {
storageCommitLatency.With(n.getMetricLabels()).Observe(time.Since(start).Seconds())
}()

ctx, cancel := context.WithCancel(roundCtx)
defer cancel()
Expand Down

0 comments on commit 62ebb4e

Please sign in to comment.