-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
protocols/kad: Extend emitted events with basic information #2087
Conversation
In combination with #2063 this can be used to generate the following Grafana graphs. More to come. |
Marked as ready for review. Anyone out there got some time for a review? Maybe @thomaseizinger? |
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.
Can't speak much on the functionality change but got two suggestions for improved naming. Hope it helps :)
protocols/kad/src/behaviour.rs
Outdated
// Note on the difference between 'request' and 'query': A request is a | ||
// single request-response style exchange with a single remote peer. A query | ||
// is made of multiple requests across multiple remote peers. | ||
InboundRequest { |
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.
The name of this variant is not very "eventy" because it doesn't contain a verb and hence doesn't really express, what happened.
What about InboundRequestServed
? That would also include the information you've packed into the docs.
protocols/kad/src/behaviour.rs
Outdated
}, | ||
|
||
/// An outbound query has produced a result. | ||
OutboundQueryResult { |
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 one could be named OutboundQueryCompleted
or OutboundQueryFinished
in the same spirit.
Changed. Thanks for the input! |
In order for users of
libp2p-kad
to gain deeper insights into the current state of the local DHT this pull request extends the events emitted bylibp2p-kad
with the information below. This is e.g. useful for #2063.protocols/kad: Expose whether routing update is new peer
Can e.g. be used to count the number of peers in the routing table.
protocols/kad: Expose inbound request information
Can e.g. be used to count the arrival rate of new records to be stored in the record store.
protocols/kad: Expose kbucket range on RoutingUpdated
Can e.g. be used to construct a graph of the current kbucket routing table state.