-
Notifications
You must be signed in to change notification settings - Fork 2.6k
client/finality-grandpa: Instrument until-imported queue #5438
Conversation
The `UntilImported` queue takes as input finality grandpa messages that depend on blocks that are not yet imported and holds them back until those blocks are imported. This commit adds a basic metric, the amount of messages waiting in the queue, to the module. For now this metric is only available for the global `UntilImported` queue awaiting blocks for commit and catch-up messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, one tiny nitpick.
// When a queue is dropped it might still contain messages. In order for those to not distort the | ||
// Prometheus metrics, the `Metric` struct cleans up after itself within its `Drop` implementation | ||
// by subtracting the local_waiting_messages (the amount of messages left in the queue about to | ||
// be dropped) from the global_waiting_messages gauge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very clever :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a bit too clever. Hope to be able to get rid of this in the future.
Co-Authored-By: Ashley <ashley.ruglys@gmail.com>
Thanks for the quick review @expenses. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changes lgtm, but going forward it probably would make sense to split between global and round-level messages (once we start counting those)
The
UntilImported
queue takes as input finality grandpa messages thatdepend on blocks that are not yet imported and holds them back until
those blocks are imported.
This commit adds a basic metric, the amount of messages waiting in the
queue, to the module. For now this metric is only available for the
global
UntilImported
queue awaiting blocks for commit and catch-upmessages.