forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
group_by.go
28 lines (26 loc) · 822 Bytes
/
group_by.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package pipeline
// A GroupByNode will group the incoming data.
// Each group is then processed independently for the rest of the pipeline.
// Only tags that are dimensions in the grouping will be preserved;
// all other tags are dropped.
//
// Example:
// stream
// .groupBy('service', 'datacenter')
// ...
//
// The above example groups the data along two dimensions `service` and `datacenter`.
// Groups are dynamically created as new data arrives and each group is processed
// independently.
type GroupByNode struct {
chainnode
//The dimensions by which to group to the data.
// tick:ignore
Dimensions []interface{}
}
func newGroupByNode(wants EdgeType, dims []interface{}) *GroupByNode {
return &GroupByNode{
chainnode: newBasicChainNode("groupby", wants, wants),
Dimensions: dims,
}
}