Skip to content
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

Replace EncoderMetrics with SendSyncEncodeMetric #202

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion protocols/gossipsub/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ wasm-timer = "0.2.5"
instant = "0.1.11"
# Metrics dependencies
# TODO: Change to v0.19 once the version has been released.
prometheus-client = { git = "https://github.com/ackintosh/client_rust.git", rev = "5e145bb0cb52ab4ff01c862a6117fb61ee107f17", features = ["protobuf"] }
# See https://github.com/prometheus/client_rust/pull/99
prometheus-client = { git = "https://github.com/ackintosh/client_rust.git", rev = "f6450001d564d4ce260a56e959f05638999fe9d8", features = ["protobuf"] }

[dev-dependencies]
async-std = "1.6.3"
Expand Down
4 changes: 2 additions & 2 deletions protocols/gossipsub/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ impl Default for Config {
/// Whether we have ever been subscribed to this topic.
type EverSubscribed = bool;

pub type TextEncoder = Box<dyn prometheus_client::encoding::text::EncodeMetric>;
pub type ProtoEncoder = Box<dyn prometheus_client::encoding::proto::EncodeMetric>;
pub type TextEncoder = Box<dyn prometheus_client::encoding::text::SendSyncEncodeMetric>;
pub type ProtoEncoder = Box<dyn prometheus_client::encoding::proto::SendSyncEncodeMetric>;
pub trait AnyEncoder: Sized {
fn new_metrics(registry: &mut Registry<Self>, config: Config) -> Metrics<Self>;
}
Expand Down