Skip to content

Commit

Permalink
update for new ql
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanielc committed Mar 16, 2016
1 parent e12728e commit 1b58dff
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ stream
.window()
.period(1m)
.every(1m)
.mapReduce(influxql.mean('value'))
.mean('value')
.eval(lambda: 100.0 - "mean")
.as('used')
.alert()
Expand Down
12 changes: 6 additions & 6 deletions cmd/kapacitord/run/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ stream
.window()
.period(10s)
.every(10s)
.mapReduce(influxql.count('value'))
.count('value')
.httpOut('count')
`

Expand Down Expand Up @@ -399,7 +399,7 @@ batch
.query(' SELECT value from mydb.myrp.cpu ')
.period(5ms)
.every(5ms)
.mapReduce(influxql.count('value'))
.count('value')
.httpOut('count')
`

Expand Down Expand Up @@ -460,7 +460,7 @@ batch
.query(' SELECT value from unknowndb.unknownrp.cpu ')
.period(5ms)
.every(5ms)
.mapReduce(influxql.count('value'))
.count('value')
.httpOut('count')
`

Expand Down Expand Up @@ -506,7 +506,7 @@ stream
.window()
.period(10s)
.every(10s)
.mapReduce(influxql.count('value'))
.count('value')
.alert()
.id('test-count')
.message('{{ .ID }} got: {{ index .Fields "count" }}')
Expand Down Expand Up @@ -849,7 +849,7 @@ stream
.window()
.period(11s)
.every(11s)
.mapReduce(influxql.last('mean')).as('mean')
.last('mean').as('mean')
.httpOut('moving_avg')
`

Expand Down Expand Up @@ -1069,7 +1069,7 @@ batch
.outliers()
.field('value')
.scale(1.5)
.mapReduce(influxql.count('value'))
.count('value')
.httpOut('count')
`

Expand Down
8 changes: 4 additions & 4 deletions examples/scores/top_scores.tick
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ var topPlayerScores = stream
.every(1s)
// Align the window boundaries to be on the second.
.align()
.mapReduce(influxql.last('value'))
.last('value')

// Calculate the top 15 scores per game
var topScores = topPlayerScores
.groupBy('game')
.mapReduce(influxql.top(15, 'last', 'player'))
.top(15, 'last', 'player')

// Expose top scores over the HTTP API at the 'top_scores' endpoint.
// Now your app can just request the top scores from Kapacitor
Expand All @@ -39,9 +39,9 @@ topScoresSampled

// Calculate the max and min of the top scores.
var max = topScoresSampled
.mapReduce(influxql.max('top'))
.max('top')
var min = topScoresSampled
.mapReduce(influxql.min('top'))
.min('top')

// Join the max and min streams back together and calculate the gap.
max.join(min)
Expand Down
8 changes: 4 additions & 4 deletions integrations/batcher_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ batch
.period(10s)
.every(10s)
.groupBy(time(2s), 'cpu')
.mapReduce(influxql.count('mean'))
.count('mean')
.window()
.period(20s)
.every(20s)
.mapReduce(influxql.sum('count'))
.sum('count')
.httpOut('TestBatch_SimpleMR')
`

Expand Down Expand Up @@ -277,11 +277,11 @@ var cpu1 = batch
cpu0.join(cpu1)
.as('cpu0', 'cpu1')
.mapReduce(influxql.count('cpu0.mean'))
.count('cpu0.mean')
.window()
.period(20s)
.every(20s)
.mapReduce(influxql.sum('count'))
.sum('count')
.httpOut('TestBatch_Join')
`

Expand Down
2 changes: 1 addition & 1 deletion pipeline/http_out.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ package pipeline
// .window()
// .period(10s)
// .every(5s)
// .mapReduce(influxql.top('value', 10))
// .top('value', 10)
// //Publish the top 10 results over the last 10s updated every 5s.
// .httpOut('top10')
//
Expand Down
4 changes: 2 additions & 2 deletions pipeline/map_reduce.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ type MapReduceInfo struct {
// .period(10s)
// .every(10s)
// // Sum the values for each 10s window of data.
// .mapReduce(influxql.sum('value'))
// .sum('value')
// ...
type MapNode struct {
chainnode
Expand Down Expand Up @@ -53,7 +53,7 @@ func newMapNode(wants EdgeType, i interface{}) *MapNode {
// .period(10s)
// .every(10s)
// // Sum the values for each 10s window of data.
// .mapReduce(influxql.sum('value'))
// .sum('value')
// ...
type ReduceNode struct {
chainnode
Expand Down
2 changes: 1 addition & 1 deletion pipeline/where.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
// Example:
// var sums = stream
// .groupBy('service', 'host')
// .mapReduce(influxdb.sum('value'))
// .sum('value')
// //Watch particular host for issues.
// sums
// .where(lambda: "host" == 'h001.example.com')
Expand Down

0 comments on commit 1b58dff

Please sign in to comment.