mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 09:17:58 +00:00
*: Update to libp2p v0.33.0 (#7759)
* *: Update to libp2p v0.33.0 * client/network: Consistently track request arrival time With https://github.com/libp2p/rust-libp2p/pull/1886/ one is guaranteed to receive either a `ResponseSent` or a `InboundFailure` event for each received inbound request via `RequestResponseEvent::Message`. Given this guarantee there is no need to track arrival times in a best-effort manner and thus there is no need to use a LRU cache for arrival times. * client/offchain: Adjust to PeerId API changes
This commit is contained in:
@@ -1373,14 +1373,11 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
|
||||
Poll::Ready(SwarmEvent::Behaviour(BehaviourOut::InboundRequest { protocol, result, .. })) => {
|
||||
if let Some(metrics) = this.metrics.as_ref() {
|
||||
match result {
|
||||
Ok(Some(serve_time)) => {
|
||||
Ok(serve_time) => {
|
||||
metrics.requests_in_success_total
|
||||
.with_label_values(&[&protocol])
|
||||
.observe(serve_time.as_secs_f64());
|
||||
}
|
||||
// Response time tracking is happening on a best-effort basis. Ignore
|
||||
// the event in case response time could not be provided.
|
||||
Ok(None) => {},
|
||||
Err(err) => {
|
||||
let reason = match err {
|
||||
ResponseFailure::Network(InboundFailure::Timeout) => "timeout",
|
||||
@@ -1388,6 +1385,8 @@ impl<B: BlockT + 'static, H: ExHashT> Future for NetworkWorker<B, H> {
|
||||
"unsupported",
|
||||
ResponseFailure::Network(InboundFailure::ResponseOmission) =>
|
||||
"busy-omitted",
|
||||
ResponseFailure::Network(InboundFailure::ConnectionClosed) =>
|
||||
"connection-closed",
|
||||
};
|
||||
|
||||
metrics.requests_in_failure_total
|
||||
|
||||
Reference in New Issue
Block a user