forked from influxdata/kapacitor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request influxdata#231 from influxdata/nc-shift
Add shift node so values from different times can be joined
- Loading branch information
Showing
11 changed files
with
508 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,3 +14,4 @@ kapacitor*.zip | |
*.pyc | ||
*.test | ||
/test-logs | ||
*.prof |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=97.1 0000000001 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=97.1 0000000001 | ||
dbname | ||
rpname | ||
disk,type=sda,host=serverB value=39 0000000001 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=92.6 0000000002 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=95.6 0000000003 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=95.6 0000000003 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=93.1 0000000004 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=93.1 0000000004 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=92.6 0000000005 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=92.6 0000000005 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=95.8 0000000006 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=95.8 0000000006 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverC value=95.8 0000000006 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=92.7 0000000007 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=92.7 0000000007 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=96.0 0000000008 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=96.0 0000000008 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=93.4 0000000009 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=93.4 0000000009 | ||
dbname | ||
rpname | ||
disk,type=sda,host=serverB value=423 0000000009 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=95.3 0000000010 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=95.3 0000000010 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=96.4 0000000011 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=96.4 0000000011 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverA value=95.1 0000000012 | ||
dbname | ||
rpname | ||
cpu,type=idle,host=serverB value=95.1 0000000012 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package pipeline | ||
|
||
import ( | ||
"time" | ||
) | ||
|
||
// Shift points and batches in time, this is useful for comparing | ||
// batches or points from different times. | ||
// | ||
// Example: | ||
// stream | ||
// .shift(5m) | ||
// | ||
// Shift all data points 5m forward in time. | ||
// | ||
// Example: | ||
// stream | ||
// .shift(-10s) | ||
// | ||
// Shift all data points 10s backward in time. | ||
type ShiftNode struct { | ||
chainnode | ||
|
||
// Keep one point or batch every Duration | ||
// tick:ignore | ||
Shift time.Duration | ||
} | ||
|
||
func newShiftNode(wants EdgeType, shift time.Duration) *ShiftNode { | ||
return &ShiftNode{ | ||
chainnode: newBasicChainNode("shift", wants, wants), | ||
Shift: shift, | ||
} | ||
} |
Oops, something went wrong.