Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Add metrics about block requests #5811

Merged
merged 2 commits into from
Apr 28, 2020

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Apr 28, 2020

Adds metrics to block requests.

This PR does the following:

  • BlockRequest::send_request now returns a SendRequestOutcome that indicates what happened (did we override a previous request?).
  • Added an block_requests::Event::AnsweredRequest event to notify that we have processed a request from the remote.
  • Added request_duration fields to block_requests::Event to indicate the time between request and the response, or the time before timeout.
  • Added metrics about how much time it took to build the response to send to other nodes.
  • Added metrics about how much time it took to obtain a response to our requests.

I deployed this PR on my node, and by looking at polkadot_sub_libp2p_requests_out_started_total - polkadot_sub_libp2p_requests_out_finished_count I can confirm that #5794 works as intended.

@tomaka tomaka added A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes labels Apr 28, 2020
@tomaka tomaka requested review from twittner and mxinden April 28, 2020 08:50
client/network/src/protocol/block_requests.rs Outdated Show resolved Hide resolved
client/network/src/service.rs Outdated Show resolved Hide resolved
});
},
block_requests::SendRequestOutcome::Replaced { request_duration, .. } => {
self.events.push(BehaviourOut::RequestFinished {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could deviate the finished histogram quite a bit as requests might take < 1ms, right? Would it make sense to differentiate between failure and success in the histogram?

Feel free to ignore.

Co-Authored-By: Max Inden <mail@max-inden.de>
@gavofyork gavofyork merged commit 0f46400 into paritytech:master Apr 28, 2020
@tomaka tomaka deleted the block-requests-stats branch April 28, 2020 17:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A0-please_review Pull request needs code review. B0-silent Changes should not be mentioned in any release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants