Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix committed May 17, 2024
1 parent 966fddc commit a4f3340
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions disperser/batcher/grpc/dispatcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,24 +79,25 @@ func (c *dispatcher) sendAllChunks(ctx context.Context, state *core.IndexedOpera

requestedAt := time.Now()
sig, err := c.sendChunks(ctx, blobMessages, batchHeader, &op)
latencyMs := float64(time.Since(requestedAt).Milliseconds())
if err != nil {
update <- core.SigningMessage{
Err: err,
Signature: nil,
Operator: id,
BatchHeaderHash: batchHeaderHash,
AttestationLatencyMs: float64(time.Since(requestedAt).Milliseconds()),
AttestationLatencyMs: latencyMs,
}
c.metrics.ObserveLatency(false, float64(time.Since(requestedAt).Milliseconds()))
c.metrics.ObserveLatency(false, latencyMs)
} else {
update <- core.SigningMessage{
Signature: sig,
Operator: id,
BatchHeaderHash: batchHeaderHash,
AttestationLatencyMs: float64(time.Since(requestedAt).Milliseconds()),
AttestationLatencyMs: latencyMs,
Err: nil,
}
c.metrics.ObserveLatency(true, float64(time.Since(requestedAt).Milliseconds()))
c.metrics.ObserveLatency(true, latencyMs)
}

}(core.IndexedOperatorInfo{
Expand Down

0 comments on commit a4f3340

Please sign in to comment.