-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Replace internal aggregate Aggregator with Measure/ComputeAggregation and a Builder #4304
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #4304 +/- ##
=====================================
Coverage 83.6% 83.7%
=====================================
Files 183 184 +1
Lines 14227 14269 +42
=====================================
+ Hits 11903 11948 +45
+ Misses 2098 2095 -3
Partials 226 226
|
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 think the split between the interfaces is good, but I found the input/output naming confusing when reading the code that uses it, as I needed to remind myself what the input and output of the aggregate package is. Aggregate takes in measurements as inputs, and outputs an aggregation. Maybe something like InputMeasurement
, and OutputAggregation
would make more sense?
In particular, seeing out
as a variable name on structs is much less clear than aggregator
is to me.
@dashpole what do you think about |
|
Would I'm a little skeptical about
|
Ha, I like ComputeAggregation most of those :) |
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.
The names are better 👍
The
Aggregator
interface is returned from theaggregate
package for all aggregate functions. The methods of this returned interface are never used by the SDK at the same place, and in some places it is deliberately split apart to avoid the generic parameter.Instead of having this mismatch, just have the
aggregate
function return input and output functions to satisfy the SDKs needs.Additionally, as this change would require a considerable update to the aggregator constructors, replace these constructors with a
Builder
introduced in #4220Part of #4220