Skip to content

Commit 60e93e7

Browse files
authored
feat(gossipsub): feature gate metrics related code
while refactoring scoring for libp2p/specs#664 I recalled #5711 and so this PR changed scope from a refactor to a feature. Per commit review is suggested for an easier experience. CC @drHuangMHT Pull-Request: #6020.
1 parent da0017e commit 60e93e7

File tree

11 files changed

+443
-350
lines changed

11 files changed

+443
-350
lines changed

protocols/gossipsub/CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
## 0.49.0
2+
- Feature gate metrics related code. This changes some `Behaviour` constructor methods.
3+
See [PR 6020](https://github.com/libp2p/rust-libp2p/pull/6020)
24
- Send IDONTWANT before Publishing a new message.
35
See [PR 6017](https://github.com/libp2p/rust-libp2p/pull/6017)
46

protocols/gossipsub/Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ categories = ["network-programming", "asynchronous"]
1212

1313
[features]
1414
wasm-bindgen = ["getrandom/js", "futures-timer/wasm-bindgen"]
15+
metrics = ["prometheus-client"]
1516

1617
[dependencies]
1718
async-channel = "2.3.1"
@@ -24,7 +25,7 @@ fnv = "1.0.7"
2425
futures = { workspace = true }
2526
futures-timer = "3.0.2"
2627
getrandom = { workspace = true }
27-
hashlink = { workspace = true}
28+
hashlink = { workspace = true }
2829
hex_fmt = "0.3.0"
2930
web-time = { workspace = true }
3031
libp2p-core = { workspace = true }
@@ -39,7 +40,7 @@ sha2 = "0.10.8"
3940
tracing = { workspace = true }
4041

4142
# Metrics dependencies
42-
prometheus-client = { workspace = true }
43+
prometheus-client = { workspace = true, optional = true }
4344

4445
[dev-dependencies]
4546
libp2p-core = { workspace = true }

0 commit comments

Comments
 (0)