-
Notifications
You must be signed in to change notification settings - Fork 329
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
fix: move object store read/write timer into inner #3627
fix: move object store read/write timer into inner #3627
Conversation
Question: |
The return value of that async method is
The operator writes to the writer later. You could refer to the metrics layer in opendal v0.45.1 It observes the timer in impl<R> Drop for MetricWrapper<R> {
fn drop(&mut self) {
self.bytes_counter.increment(self.bytes);
if let Some(instant) = self.start {
let dur = instant.elapsed().as_secs_f64();
self.requests_duration_seconds.record(dur);
}
}
} This behavior changes in the main branch after apache/opendal#4381 but v0.45.1 is still the latest release we are using so we should follow its implementation. I have updated links in #3622 |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3627 +/- ##
==========================================
- Coverage 85.36% 84.81% -0.55%
==========================================
Files 935 943 +8
Lines 156348 156962 +614
==========================================
- Hits 133463 133128 -335
- Misses 22885 23834 +949 |
@evenyag Thanks for your information. Please take a took. |
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.
We should move the histogram timer to the PrometheusMetricWrapper
. The timer will track the start time and duration for us.
@evenyag I leave some messages, please take a look. |
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.
We can get rid of Option
in this way.
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.
LGTM
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.
LGTM
* fix: move object store read/write timer into inner * add Drop for PrometheusMetricWrapper * call await on async read/write * apply review comments * git rid of option on timer
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
#3622
What's changed and what's your intention?
Move timer from read/write function into
PrometheusMetricWrapper
and update data when dropping to get accurate metric.Checklist