Skip to content
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

[index] Standardizes aggregate interfaces #1502

Merged
merged 4 commits into from
Mar 27, 2019

Conversation

arnikola
Copy link
Collaborator

This PR fulfills several outstanding tasks for the aggregate endpoint:

  • Integrates the interfaces from the RPC PR here: dbnode Aggregate RPC implementation #1483 and flows them through the stack, from the db session down to the index itself.
  • Adds capability to return tag names only, while defaulting to names+values (my bad, forgot to add it initially!)

This allows the query side PR(#1481) to be updated and landed, and minimizes required end-to-end work on #1483

@codecov
Copy link

codecov bot commented Mar 27, 2019

Codecov Report

Merging #1502 into master will decrease coverage by <.1%.
The diff coverage is 83.6%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1502     +/-   ##
========================================
- Coverage      71%   70.9%   -0.1%     
========================================
  Files         849     849             
  Lines       72250   72290     +40     
========================================
+ Hits        51311   51318      +7     
- Misses      17581   17616     +35     
+ Partials     3358    3356      -2
Flag Coverage Δ
#aggregator 82.3% <ø> (ø) ⬆️
#cluster 85.7% <ø> (ø) ⬆️
#collector 63.7% <ø> (ø) ⬆️
#dbnode 80.8% <95.3%> (-0.1%) ⬇️
#m3em 73.2% <ø> (ø) ⬆️
#m3ninx 74.3% <ø> (-0.1%) ⬇️
#m3nsch 51.1% <ø> (ø) ⬆️
#metrics 17.5% <ø> (ø) ⬆️
#msg 75% <ø> (+0.1%) ⬆️
#query 66% <0%> (-0.1%) ⬇️
#x 76.2% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5e4d4f6...b2e80a5. Read the comment docs.

if err != nil {
return err
for _, doc := range batch {
if r.aggregateOpts.Type == AggregateTagNamesAndValues {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe switch here and return if unknown?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call 👍


// LimitExceeded returns whether a given size exceeds the limit
// the query options imposes, if it is enabled.
func (o AggregationOptions) LimitExceeded(size int) bool {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the embedding should give this to you fo free iirc

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice 👍

@@ -186,6 +209,9 @@ type AggregateResultsOptions struct {

// Optional param to filter aggregate values.
TermFilter AggregateTermFilter

// Type determines what result is required.
Type AggregationType
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you delete AggregateResultsOptions now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wanted to keep it as similar as possible to the regular Query path which does a similar thing when it breaks out the options relating to the result from those relating to the query parameters here

Copy link
Collaborator

@prateek prateek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM save minor nits

@arnikola arnikola merged commit 4aa3e59 into master Mar 27, 2019
@arnikola arnikola deleted the arnikola/match-aggregate-interfaces branch March 27, 2019 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants