- 
                Notifications
    
You must be signed in to change notification settings  - Fork 25.6k
 
Copy metrics and default_metric properties when downsampling aggregate_metric_double #121727
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
Conversation
| 
           Pinging @elastic/es-storage-engine (Team:StorageEngine)  | 
    
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.
One minor comment, LGTM otherwise.
I think merge conflict comes from #121254, shouldn't be to difficult to fix.
| List<String> supportedAggs = List.of(metricType.supportedAggs()); | ||
| // We choose max as the default metric | ||
| final String defaultMetric = List.of(supportedAggsArray).contains("max") ? "max" : supportedAggsArray[0]; | ||
| String defaultMetric = supportedAggs.contains("max") ? "max" : supportedAggs.get(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.
Maybe isolate the logic that extracts default metrics in a (static?) method? Then we can maybe add a unit test for this in TransportDownsampleActionTests.
| 
           Hi @jordan-powers, I've created a changelog YAML for you.  | 
    
088bd78    to
    53193f3      
    Compare
  
    | builder.field("type", AggregateMetricDoubleFieldMapper.CONTENT_TYPE) | ||
| .array(AggregateMetricDoubleFieldMapper.Names.METRICS, supportedAggsArray) | ||
| .field(AggregateMetricDoubleFieldMapper.Names.DEFAULT_METRIC, defaultMetric) | ||
| .array(AggregateMetricDoubleFieldMapper.Names.METRICS, supportedMetricsArray) | 
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.
nit: looks like you could use stringListField and avoid the array
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.
Ah, I thought there might be an API like that, but I couldn't find it. Thanks!
…e_metric_double (elastic#121727) Fixes elastic#119696 and elastic#96076
…e_metric_double (elastic#121727) Fixes elastic#119696 and elastic#96076
Fixes #119696
Fixes #96076