-
Notifications
You must be signed in to change notification settings - Fork 0
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
Make encode
return iterator instead of vec
#2
Conversation
Build error below occurs: error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates --> src/encoding/proto.rs:199:6 | 199 | impl<'a, N, A> EncodeMetric for Counter<N, A> | ^^ unconstrained lifetime parameter
Build error: error[E0207]: the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates --> src/encoding/proto.rs:199:6 | 199 | impl<'a, N, A> EncodeMetric for Counter<N, A> | ^^ unconstrained lifetime parameter
I have compared the allocation count between this branch and the Diffs of source code to check allocation count
The results of allocation count were equal 🤔
$ cargo test --lib encoding::proto::tests::encode_counter_family_with_prefix_with_label --all-features -- --show-output
successes:
---- encoding::proto::tests::encode_counter_family_with_prefix_with_label stdout ----
allocation: 49
$ cargo test --lib encoding::proto::tests::encode_counter_family_with_prefix_with_label --all-features -- --show-output
successes:
---- encoding::proto::tests::encode_counter_family_with_prefix_with_label stdout ----
allocation: 49 I think, using |
Thanks for experimenting here. I have a patch on top of this patch in the working. Will report back hopefully end of the day @ackintosh. |
I played around with this a bit. Thus far I don't have a full solution yet. I think mxinden@2e04787 is a step forward, removing the Still need to give it more thought though. |
src/encoding/proto: Refactor EncodeLabel and EncodeMetric
This branch is based on
protobuf-support
. Ref: prometheus#47