Skip to content

Commit

Permalink
Merge pull request influxdata#1619 from influxdata/md-all-nodes
Browse files Browse the repository at this point in the history
Add example of all nodes in load tasks style dir
  • Loading branch information
desa authored Oct 24, 2017
2 parents 6e45b39 + d25510d commit e0251a5
Show file tree
Hide file tree
Showing 24 changed files with 219 additions and 0 deletions.
8 changes: 8 additions & 0 deletions examples/nodes/tasks/alert.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy(*)
|alert()
.crit(lambda: "usage_user" > 80)
6 changes: 6 additions & 0 deletions examples/nodes/tasks/batch.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dbrp "telegraf"."autogen"

batch
|query('SELECT mean("usage_user") FROM "telegraf"."autogen"."cpu"')
.period(1m)
.every(10s)
8 changes: 8 additions & 0 deletions examples/nodes/tasks/combine.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy(*)
|combine(lambda: "cpu" == 'cpu-total', lambda: TRUE)
.as('total', 'cpu')
9 changes: 9 additions & 0 deletions examples/nodes/tasks/default.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy(*)
|default()
.tag('sweet_new_tag', 'this_is')
.field('value', 10.9)
9 changes: 9 additions & 0 deletions examples/nodes/tasks/delete.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy(*)
|delete()
.tag('cpu')
.field('usuage_idle')
7 changes: 7 additions & 0 deletions examples/nodes/tasks/eval.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
|eval(lambda: 100.0 - "usage_idle")
.as('usage_not_idle')
7 changes: 7 additions & 0 deletions examples/nodes/tasks/flatten.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
|flatten()
.on('cpu')
6 changes: 6 additions & 0 deletions examples/nodes/tasks/groupby.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('system')
|groupBy(*)
6 changes: 6 additions & 0 deletions examples/nodes/tasks/handle_loopback.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dbrp "loopback"."autogen"

stream
|from()
.measurement('system')
.groupBy(*)
9 changes: 9 additions & 0 deletions examples/nodes/tasks/httpout.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('system')
|window()
.period(1m)
.every(10s)
|httpOut('data')
9 changes: 9 additions & 0 deletions examples/nodes/tasks/httppost.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('system')
|window()
.period(1m)
.every(10s)
|httpPost('http://localhost:8080/example')
13 changes: 13 additions & 0 deletions examples/nodes/tasks/influxdbout.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('system')
|window()
.period(1m)
.every(10s)
|mean('load1')
.as('load1')
|influxDBOut()
.database('mydb')
.measurement('derived_system')
29 changes: 29 additions & 0 deletions examples/nodes/tasks/join.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
dbrp "telegraf"."autogen"

var cpu = stream
|from()
.measurement('cpu')
.groupBy(*)
|window()
.period(30s)
.every(10s)
.align()
|mean('usage_user')
.as('value')

var mem = stream
|from()
.measurement('mem')
.groupBy(*)
|window()
.period(30s)
.every(10s)
.align()
|mean('free')
.as('value')

cpu
|join(mem)
.as('cpu', 'mem')
|eval(lambda: "cpu.value" / "mem.value")
.as('cpu_mem_free_ratio')
7 changes: 7 additions & 0 deletions examples/nodes/tasks/log.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('system')
.groupBy(*)
|log()
9 changes: 9 additions & 0 deletions examples/nodes/tasks/loopback.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('system')
.groupBy(*)
|kapacitorLoopback()
.database('loopback')
.retentionPolicy('autogen')
7 changes: 7 additions & 0 deletions examples/nodes/tasks/sample.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy('host')
|sample(3)
7 changes: 7 additions & 0 deletions examples/nodes/tasks/shift.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy('host')
|shift(1m)
8 changes: 8 additions & 0 deletions examples/nodes/tasks/statecount.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
|where(lambda: "cpu" == 'cpu-total')
|groupBy('host')
|stateCount(lambda: "usage_idle" <= 10)
9 changes: 9 additions & 0 deletions examples/nodes/tasks/stateduration.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
|where(lambda: "cpu" == 'cpu-total')
|groupBy('host')
|stateDuration(lambda: "usage_idle" <= 10)
.unit(1m)
7 changes: 7 additions & 0 deletions examples/nodes/tasks/stats.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy('host')
|stats(30s)
6 changes: 6 additions & 0 deletions examples/nodes/tasks/stream.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy('host')
17 changes: 17 additions & 0 deletions examples/nodes/tasks/union.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
dbrp "telegraf"."autogen"

var cpu = stream
|from()
.measurement('cpu')

var mem = stream
|from()
.measurement('mem')

var system = stream
|from()
.measurement('system')

cpu
|union(mem, system)
.rename('stats')
7 changes: 7 additions & 0 deletions examples/nodes/tasks/where.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy('host')
|where(lambda: "cpu" == 'cpu-total')
9 changes: 9 additions & 0 deletions examples/nodes/tasks/window.tick
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
dbrp "telegraf"."autogen"

stream
|from()
.measurement('cpu')
.groupBy('host')
|window()
.period(1m)
.every(1m)

0 comments on commit e0251a5

Please sign in to comment.