Closed illia-malachyn closed 1 month ago
The recent changes enhance the precision of duration measurements in the MeasureRequestDuration
method of the DefaultCollector
class. By switching from float64(time.Since(start))
to time.Since(start).Seconds()
, the adjustments refine how request durations are observed, ensuring a more accurate representation. This modification addresses issues with histogram metrics accuracy while maintaining existing control flow.
Files | Change Summary |
---|---|
metrics/collector.go | Modified MeasureRequestDuration to improve precision by using time.Since(start).Seconds() instead of float64(time.Since(start)) . |
Objective | Addressed | Explanation |
---|---|---|
Metric floating point values should be emitted verbatim without rounding (#441) | ✅ | |
Metric values correspond to the correct bucket they belong to (#441) | ❌ | The current change does not address bucket allocation. |
🐇 In the meadow where data flows,
A change made the timing glow,
No more rounding to bring us woes,
Metrics now dance, precise as they pose.
Hooray for the seconds, so clear, so bright,
Collecting our metrics, all day and night! 🌼
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
@franklywatson
I tested it locally, it was silly of me to do that conversion.
I'm leaving default buckets for now as their values look fine to me (5ms-10s range). We may adjust them when we have more info on how long our endpoints respond to a user
Closes #441
Summary by CodeRabbit