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

Feat/254 int histogram #388

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

Conversation

hdost
Copy link

@hdost hdost commented Feb 9, 2021

No description provided.

@hdost hdost mentioned this pull request Feb 9, 2021
@@ -217,9 +217,11 @@ pub use self::encoder::TextEncoder;
pub use self::encoder::{PROTOBUF_FORMAT, TEXT_FORMAT};
pub use self::errors::{Error, Result};
pub use self::gauge::{Gauge, GaugeVec, IntGauge, IntGaugeVec};
#[deprecated(since = "0.12.0", note = "Please use DEFAULT_FLOAT_BUCKETS")]
pub use self::histogram::DEFAULT_BUCKETS;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Considering that Histogram is called Histogram instead of FloatHistogram, I suggest to keep DEFAULT_BUCKETS and not being DEFAULT_FLOAT_BUCKETS. What do you think?

@@ -41,9 +48,34 @@ fn check_bucket_label(label: &str) -> Result<()> {
Ok(())
}

fn check_and_adjust_buckets(mut buckets: Vec<f64>) -> Result<Vec<f64>> {
fn check_and_adjust_int_buckets(mut buckets: Vec<u64>) -> Result<Vec<u64>> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can use generics to avoid writing code twice.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what i can tell this would require a bit of a re-architecture. I will take a closer look this may be a breaking change and see what i can do.


}

impl IntHistogramCore {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd better avoid duplicating these codes. You can try with generics!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants