*: Update to new query stat libp2p version

This commit is contained in:
Max Inden 2020-05-11 10:11:24 +02:00
parent 58a64936d9
commit 2afdf8fba7
No known key found for this signature in database
GPG Key ID: 5403C5464810BC26
2 changed files with 32 additions and 30 deletions

48
Cargo.lock generated
View File

@ -1290,7 +1290,7 @@ checksum = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558"
[[package]]
name = "libp2p"
version = "0.18.1"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"bytes 0.5.4",
"futures 0.3.4",
@ -1327,7 +1327,7 @@ dependencies = [
[[package]]
name = "libp2p-core"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"asn1_der",
"bs58",
@ -1360,7 +1360,7 @@ dependencies = [
[[package]]
name = "libp2p-core-derive"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"quote",
"syn",
@ -1369,7 +1369,7 @@ dependencies = [
[[package]]
name = "libp2p-deflate"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"flate2",
"futures 0.3.4",
@ -1379,7 +1379,7 @@ dependencies = [
[[package]]
name = "libp2p-dns"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"futures 0.3.4",
"libp2p-core",
@ -1389,7 +1389,7 @@ dependencies = [
[[package]]
name = "libp2p-floodsub"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"cuckoofilter",
"fnv",
@ -1405,7 +1405,7 @@ dependencies = [
[[package]]
name = "libp2p-gossipsub"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"base64",
"byteorder 1.3.2",
@ -1429,7 +1429,7 @@ dependencies = [
[[package]]
name = "libp2p-identify"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"futures 0.3.4",
"libp2p-core",
@ -1444,7 +1444,7 @@ dependencies = [
[[package]]
name = "libp2p-kad"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"arrayvec 0.5.1",
"bytes 0.5.4",
@ -1470,7 +1470,7 @@ dependencies = [
[[package]]
name = "libp2p-mdns"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"async-std",
"data-encoding",
@ -1491,7 +1491,7 @@ dependencies = [
[[package]]
name = "libp2p-mplex"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"bytes 0.5.4",
"fnv",
@ -1506,7 +1506,7 @@ dependencies = [
[[package]]
name = "libp2p-noise"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"curve25519-dalek 2.0.0",
"futures 0.3.4",
@ -1526,7 +1526,7 @@ dependencies = [
[[package]]
name = "libp2p-ping"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"futures 0.3.4",
"libp2p-core",
@ -1540,7 +1540,7 @@ dependencies = [
[[package]]
name = "libp2p-plaintext"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"bytes 0.5.4",
"futures 0.3.4",
@ -1557,7 +1557,7 @@ dependencies = [
[[package]]
name = "libp2p-pnet"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"futures 0.3.4",
"log",
@ -1570,7 +1570,7 @@ dependencies = [
[[package]]
name = "libp2p-secio"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"aes-ctr",
"ctr",
@ -1599,7 +1599,7 @@ dependencies = [
[[package]]
name = "libp2p-swarm"
version = "0.18.1"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"futures 0.3.4",
"libp2p-core",
@ -1613,7 +1613,7 @@ dependencies = [
[[package]]
name = "libp2p-tcp"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"async-std",
"futures 0.3.4",
@ -1628,7 +1628,7 @@ dependencies = [
[[package]]
name = "libp2p-uds"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"async-std",
"futures 0.3.4",
@ -1639,7 +1639,7 @@ dependencies = [
[[package]]
name = "libp2p-wasm-ext"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"futures 0.3.4",
"js-sys",
@ -1652,7 +1652,7 @@ dependencies = [
[[package]]
name = "libp2p-websocket"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"async-tls",
"bytes 0.5.4",
@ -1672,7 +1672,7 @@ dependencies = [
[[package]]
name = "libp2p-yamux"
version = "0.18.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"futures 0.3.4",
"libp2p-core",
@ -1854,7 +1854,7 @@ checksum = "d8883adfde9756c1d30b0f519c9b8c502a94b41ac62f696453c37c7fc0a958ce"
[[package]]
name = "multistream-select"
version = "0.8.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"bytes 0.5.4",
"futures 0.3.4",
@ -1935,7 +1935,7 @@ checksum = "2839e79665f131bdb5782e51f2c6c9599c133c6098982a54c794358bf432529c"
[[package]]
name = "parity-multiaddr"
version = "0.8.0"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#ae27c3774038c7d5ea798390ace212cfcee83806"
source = "git+https://github.com/mxinden/rust-libp2p?branch=disjoint-paths-2-query-info#c84cf17e2ba47b14fd23c23dd8f1b2387cabda2b"
dependencies = [
"arrayref",
"bs58",

View File

@ -255,14 +255,16 @@ impl Exporter {
.kad_query_stats
.with_label_values(&[&name, query_name, "num_failures"])
.observe(stats.num_failures().into());
// self.metrics
// .kad_query_stats
// .with_label_values(&[&name, query_name, "num_pending"])
// .observe(stats.pending().into());
self.metrics
.kad_query_stats
.with_label_values(&[&name, query_name, "duration"])
.observe(stats.duration().as_secs_f64());
.with_label_values(&[&name, query_name, "num_pending"])
.observe(stats.num_pending().into());
if let Some(duration) = stats.duration() {
self.metrics
.kad_query_stats
.with_label_values(&[&name, query_name, "duration"])
.observe(duration.as_secs_f64());
}
},
// Note: Do not interpret Discovered event as a proof of a node
// being online.