-
Notifications
You must be signed in to change notification settings - Fork 188
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
refactor: histogram #293
refactor: histogram #293
Conversation
I just implmented generic version of some types in `histogram.rs`.The problem of loss of precision needs to be solved, perhaps make accurate to milliseconds when calling `observe` function.
I just implemented generic version of some types in @breeswish |
src/histogram.rs
Outdated
@@ -397,21 +408,29 @@ impl HistogramTimer { | |||
let v = duration_to_seconds(self.start.elapsed()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Accurate to milliseconds should fix this, is it OK to do so? @breeswish
src/histogram.rs
Outdated
@@ -397,21 +408,29 @@ impl HistogramTimer { | |||
let v = duration_to_seconds(self.start.elapsed()); | |||
self.observed = true; | |||
if record { | |||
self.histogram.observe(v); | |||
// FIXME: 精度丢失 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't use Chinese comments
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, fixed in last commit
- make `DEFAULT_BUCKETS` accurate to milliseconds - and adapted to relevant test cases
src/histogram.rs
Outdated
core: Arc<HistogramCore<S, C>>, | ||
} | ||
|
||
/// /// A [`Metric`](::core::Metric) counts individual observations from an event or sample stream in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
duplicate ///
mark
src/histogram.rs
Outdated
@@ -397,21 +408,29 @@ impl HistogramTimer { | |||
let v = duration_to_seconds(self.start.elapsed()); | |||
self.observed = true; | |||
if record { | |||
self.histogram.observe(v); | |||
// FIXME: 精度丢失 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, fixed in last commit
also fix duplicated `///` mark
@chux0519 Thanks for the PR! Looks like your PR makes a breaking change that previously |
you are right, I will definitely fix this |
@chux0519 are you planning to continue the work on this pull request? If not, I would close here. |
Sorry, I may not be able to continue this PR, it can be closed |
Open the PR.
Still have problem to be solved.
See the FIXME part in code