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

[dbnode] Add rpc/AggregateQuery types #1460

Merged
merged 2 commits into from
Mar 16, 2019

Conversation

prateek
Copy link
Collaborator

@prateek prateek commented Mar 14, 2019

Only adding the rpc interface for some of the work related to #1453

/cc @arnikola @richardartoul

8: optional TimeType resultTimeType = TimeType.UNIX_SECONDS
}

struct AggregateQueryResult {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

TBH: intentionally avoiding making this a generic type tree. I'm sure we can do aggregation functions in the future but until it's needed it's easier to not introduce the complexity.

Copy link
Contributor

@richardartoul richardartoul left a comment

Choose a reason for hiding this comment

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

LGTM

// We currently only support retrieval of facets, but could extend this based on
// requirements in the future. Currently, the two predominant use-cases are:
// (1) Given a filter query (optionally), return all known tag keys matching this restriction
// (2) Given a filter query (optionally), return all know tag key+values matching this restriction
Copy link
Collaborator

@arnikola arnikola Mar 15, 2019

Choose a reason for hiding this comment

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

Should this take in an optional result filter on keys? As an example, if I'm doing a graphite query for say, foo.bar.*, I only want to list the values matching the restriction for __g2__, rather than for any tags that come after. For graphite we can do something silly like add __g3__ !=~ ".*" to soft-restrict this to the desired output, but that doesn't really translate well to arbitrary tag/values

i.e. with foo.bar.* as a query, and the following metrics:

foo.bar.biz
foo.bar.qux
foo.bar.a.b

the result should be [ "__g2__" : [biz, qux, a] ]

(sorry for using mostly graphite here, it's easier than writing out tags explicitly for the example :p)

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 like it. I'll add something equivalent to resultFilter []string where empty means no filtering

3: required i64 rangeEnd
4: required string nameSpace
5: optional i64 limit
6: optional AggregateQueryType aggregateQueryType = AggregateQueryType.AGGREGATE_BY_TAG_NAME_VALUE
Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think this should be optional; would be better for callers to explicitly state what query type is required

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Only reason to make it optional is for the case where people just curl this endpoint to see distinct tags. Seems unnecessary to make them also specify this.

That said, I agree - all the stuff calling this endpoint programmatically should totally be specifying this.

// AggregateQueryRequest comes from our desire to aggregate on incoming data.
// We currently only support retrieval of facets, but could extend this based on
// requirements in the future. Currently, the two predominant use-cases are:
// (1) Given a filter query (optionally), return all known tag keys matching this restriction
Copy link
Collaborator

@arnikola arnikola Mar 15, 2019

Choose a reason for hiding this comment

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

This comment is a little incorrect since Query is not an optional param (the no filter case would be something like .* which is still a query, rather than a nil)

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 catch, made Query optional

@codecov
Copy link

codecov bot commented Mar 15, 2019

Codecov Report

Merging #1460 into master will decrease coverage by 11.7%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #1460      +/-   ##
=========================================
- Coverage    70.9%   59.1%   -11.8%     
=========================================
  Files         840     409     -431     
  Lines       71773   35273   -36500     
=========================================
- Hits        50929   20871   -30058     
+ Misses      17518   12892    -4626     
+ Partials     3326    1510    -1816
Flag Coverage Δ
#aggregator 67% <ø> (-15.3%) ⬇️
#cluster 85.2% <ø> (-0.7%) ⬇️
#collector 39.1% <ø> (-24.6%) ⬇️
#dbnode 76.4% <ø> (-4.5%) ⬇️
#m3em 45.7% <ø> (-27.5%) ⬇️
#m3ninx 67.7% <ø> (-6.6%) ⬇️
#m3nsch 100% <ø> (+48.8%) ⬆️
#metrics 17.6% <ø> (ø) ⬆️
#msg 74.9% <ø> (ø) ⬆️
#query 58.1% <ø> (-8.1%) ⬇️
#x 70.9% <ø> (-5.5%) ⬇️

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 dc35308...4ebc13b. Read the comment docs.

@codecov
Copy link

codecov bot commented Mar 15, 2019

Codecov Report

Merging #1460 into master will increase coverage by <.1%.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #1460     +/-   ##
========================================
+ Coverage    70.9%   70.9%   +<.1%     
========================================
  Files         841     841             
  Lines       71891   71895      +4     
========================================
+ Hits        50981   50988      +7     
+ Misses      17562   17561      -1     
+ Partials     3348    3346      -2
Flag Coverage Δ
#aggregator 82.3% <ø> (-0.1%) ⬇️
#cluster 85.8% <ø> (ø) ⬆️
#collector 63.7% <ø> (ø) ⬆️
#dbnode 80.8% <0%> (ø) ⬆️
#m3em 73.2% <ø> (ø) ⬆️
#m3ninx 74.2% <ø> (ø) ⬆️
#m3nsch 51.1% <ø> (ø) ⬆️
#metrics 17.6% <ø> (ø) ⬆️
#msg 74.9% <ø> (ø) ⬆️
#query 66% <ø> (ø) ⬆️
#x 76.3% <ø> (ø) ⬆️

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 a03b3f0...c80d50b. Read the comment docs.

@prateek prateek force-pushed the prateek/dbnode/aggregate-rpc-iface branch from e35bee0 to c80d50b Compare March 15, 2019 22:08
@prateek prateek merged commit c8b63b8 into master Mar 16, 2019
@prateek prateek deleted the prateek/dbnode/aggregate-rpc-iface branch March 16, 2019 01:12
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