-
Notifications
You must be signed in to change notification settings - Fork 438
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
[Metrics SDK] Histogram min/max support #1540
Conversation
Codecov Report
@@ Coverage Diff @@
## main #1540 +/- ##
==========================================
+ Coverage 83.90% 83.98% +0.09%
==========================================
Files 156 156
Lines 4873 4905 +32
==========================================
+ Hits 4088 4119 +31
- Misses 785 786 +1
|
@@ -147,6 +149,8 @@ TEST(OStreamMetricsExporter, ExportHistogramPointData) | |||
"\n type : HistogramPointData" | |||
"\n count : 3" | |||
"\n sum : 900" | |||
"\n min : 0" | |||
"\n max : 0" |
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.
Why are these values 0?
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.
It was because histogram_point_data
, had default min and max.
thanks, added proper min & max now.
@@ -21,6 +21,7 @@ class HistogramAggregationConfig : public AggregationConfig | |||
{ | |||
public: | |||
std::list<T> boundaries_; | |||
bool record_min_max_ = true; |
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.
Seems we are setting it, but not using it :).
Pls ignore, it's been used. Sorry about that.
if (merge.record_min_max_) | ||
{ | ||
merge.min_ = std::min(nostd::get<T>(current.min_), nostd::get<T>(delta.min_)); | ||
merge.max_ = std::max(nostd::get<T>(current.max_), nostd::get<T>(delta.max_)); |
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.
Not sure how to handle for HistogramDiff
, should we set record_min_max_ to false
?
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.
I set it to false
for now.
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.
Looks good to merge, once we have a decision on how to handle Histogram Diff as mentioned in the comment.
Fixes #1443 (issue)
Changes
adds min/max recording to Histograms
makes this configurable via the Aggregation
Update proto to 0.18.0 to make it exportable.
For significant contributions please make sure you have completed the following items:
CHANGELOG.md
updated for non-trivial changes