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

Be able to join dynamically on Groups #46

Closed
nathanielc opened this issue Nov 12, 2015 · 2 comments · Fixed by #693
Closed

Be able to join dynamically on Groups #46

nathanielc opened this issue Nov 12, 2015 · 2 comments · Fixed by #693
Milestone

Comments

@nathanielc
Copy link
Contributor

Thinking about how you could join across groups of the same measurement.

Joining across measurements is straight forward and documented.

How would you join two different groups from the same measurement? Do you even need to? I think so and I think you may want to do it dynamically as well.

Proposed solution:

.joinOnGroups(<group_selector or star>, ...)

A group select could just be { 'dim1' : 'value1', 'dim2': 'value2'} etc.

The number of arguments to joinObGroups indicates how many series are joined,

A * indicates all groups.
For example:

stream
  .from('errors')
  .groupBy('page', 'section')
  // do some work
  .joinOnGroups({'page' : 'home', 'section':'sidebar'}, *)
    .as('home', 'other')
  // do more work on the joined data.

This would join the home page sidebar section with every other page section group. Producing a new groups with tags like:

{
 home.page: home,
 home.section: sidebar,
 other.page: login,
 other.section: oauth,
}

Seems like manipulating tags like we do fields with dot separators is a simple solution.

Going to think on this some more but it feels like a good start.

@nathanielc nathanielc added this to the v0.1.2 milestone Nov 12, 2015
@nathanielc nathanielc modified the milestones: v0.12, v0.1.2 Feb 5, 2016
@yosiat
Copy link
Contributor

yosiat commented Feb 23, 2016

This feature is pretty useful for my use case, I am currently creating alerts that looks on multiple instances and check their status relatively to other (for example: checking distribution of data/users between instances from the same type -> "all web servers should divide the users count euqaly").

So in my use case I can:

stream.from('users_count').groupBy('type').joinOnGroups(*).as('app1', 'app2')
// do some alert for (app1 / (app1.users_count + app2.users_count) / 2 (numbers of instance)) or app2.

Explanation of the calculation: to see if one instance has more than average user count and to alert on it.

@nathanielc
Copy link
Contributor Author

@yosiat Thanks for the feedback. Glad to see its not just my crazy idea but that others have a use case in mind.

@nathanielc nathanielc modified the milestones: v0.11, v0.12 Feb 24, 2016
@nathanielc nathanielc modified the milestones: v0.12, v0.11 Mar 10, 2016
@nathanielc nathanielc modified the milestones: v0.12, v0.13, v0.14 Mar 29, 2016
@nathanielc nathanielc modified the milestones: v0.15, v0.14 Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants