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

Add shift node so values from different times can be joined #231

Merged
merged 1 commit into from
Feb 11, 2016

Conversation

nathanielc
Copy link
Contributor

Example from tests:

var period  = 5s

var data  = stream
    .from()
        .measurement('cpu')
        .where(lambda: "host" == 'serverA')

var past = data
    .window()
        .period(period)
        .every(period)
        .align()
    .mapReduce(influxql.count('value'))
    //shift values from the past forward so they can be compared with current values.
    .shift(period)

var current = data
    .window()
        .period(period)
        .every(period)
        .align()
    .mapReduce(influxql.count('value'))

past.join(current)
    .as('past', 'current')
    .eval(lambda: "current.count" - "past.count")
        .keep()
        .as('diff')
    .httpOut('TestStream_Shift')

nathanielc pushed a commit that referenced this pull request Feb 11, 2016
Add shift node so values from different times can be joined
@nathanielc nathanielc merged commit 4e5a5e5 into master Feb 11, 2016
@nathanielc nathanielc deleted the nc-shift branch February 11, 2016 23:53
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.

1 participant