mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
feat: add metric for block gossip time (#12670)
This commit is contained in:
parent
183e72b194
commit
a44c209be0
@ -125,6 +125,12 @@ var (
|
||||
Help: "Time to verify gossiped blocks",
|
||||
},
|
||||
)
|
||||
blockArrivalGossipSummary = promauto.NewSummary(
|
||||
prometheus.SummaryOpts{
|
||||
Name: "gossip_block_arrival_milliseconds",
|
||||
Help: "Time for gossiped blocks to arrive",
|
||||
},
|
||||
)
|
||||
|
||||
// Sync committee verification performance.
|
||||
syncMessagesForUnknownBlocks = promauto.NewCounter(
|
||||
|
@ -200,15 +200,20 @@ func (s *Service) validateBeaconBlockPubSub(ctx context.Context, pid peer.ID, ms
|
||||
return pubsub.ValidationIgnore, err
|
||||
}
|
||||
graffiti := blk.Block().Body().Graffiti()
|
||||
|
||||
sinceSlotStartTime := receivedTime.Sub(startTime)
|
||||
validationTime := prysmTime.Now().Sub(receivedTime)
|
||||
log.WithFields(logrus.Fields{
|
||||
"blockSlot": blk.Block().Slot(),
|
||||
"sinceSlotStartTime": receivedTime.Sub(startTime),
|
||||
"validationTime": prysmTime.Now().Sub(receivedTime),
|
||||
"sinceSlotStartTime": sinceSlotStartTime,
|
||||
"validationTime": validationTime,
|
||||
"proposerIndex": blk.Block().ProposerIndex(),
|
||||
"graffiti": string(graffiti[:]),
|
||||
}).Debug("Received block")
|
||||
|
||||
blockVerificationGossipSummary.Observe(float64(prysmTime.Since(receivedTime).Milliseconds()))
|
||||
blockArrivalGossipSummary.Observe(float64(sinceSlotStartTime))
|
||||
blockVerificationGossipSummary.Observe(float64(validationTime))
|
||||
|
||||
return pubsub.ValidationAccept, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user