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.
clean up some old logging (influxdata#568)
- Loading branch information
Nathaniel Cook
committed
May 19, 2016
1 parent
4767348
commit aa2bdc1
Showing
3 changed files
with
25 additions
and
22 deletions.
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 |
---|---|---|
@@ -1,27 +1,27 @@ | ||
// Get errors batch data | ||
var errors = batch | ||
.query('SELECT sum(value) FROM "pages"."default".errors') | ||
.period(1h) | ||
.every(1h) | ||
.groupBy(time(1m), *) | ||
.fill(0) | ||
|query('SELECT sum(value) FROM "pages"."default".errors') | ||
.period(1h) | ||
.every(1h) | ||
.groupBy(time(1m), *) | ||
.fill(0) | ||
|
||
// Get views batch data | ||
var views = batch | ||
.query('SELECT sum(value) FROM "pages"."default".views') | ||
.period(1h) | ||
.every(1h) | ||
.groupBy(time(1m), *) | ||
.fill(0) | ||
|query('SELECT sum(value) FROM "pages"."default".views') | ||
.period(1h) | ||
.every(1h) | ||
.groupBy(time(1m), *) | ||
.fill(0) | ||
|
||
// Join errors and views | ||
errors.join(views) | ||
.as('errors', 'views') | ||
//Calculate percentage | ||
.eval(lambda: "errors.sum" / ("views.sum" + "errors.sum")) | ||
// Give the resulting field a name | ||
.as('value') | ||
.influxDBOut() | ||
.database('pages') | ||
.measurement('error_percent') | ||
|
||
errors | ||
|join(views) | ||
.as('errors', 'views') | ||
// Calculate percentage | ||
|eval(lambda: "errors.sum" / ("views.sum" + "errors.sum")) | ||
// Give the resulting field a name | ||
.as('value') | ||
|influxDBOut() | ||
.database('pages') | ||
.measurement('error_percent') |
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