Skip to content

Commit

Permalink
Show spike data in error message (#117)
Browse files Browse the repository at this point in the history
Show spike data in error message
  • Loading branch information
Adam Braimbridge authored Jun 4, 2019
2 parents ce34059 + 669bf58 commit 4e29ce7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/checks/graphiteSpike.check.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,14 @@ class GraphiteSpikeCheck extends Check {
? data.sample / data.baseline < this.threshold
: data.sample / data.baseline > 1 / this.threshold;

this.status = ok ? status.PASSED : status.FAILED;
this.checkOutput = ok ? 'No spike detected in graphite data' : 'Spike detected in graphite data';
const details = `Direction: ${this.direction} Sample: ${data.sample} Baseline: ${data.baseline} Threshold: ${this.threshold}`
if (ok) {
this.status = status.PASSED;
this.checkOutput = `No spike detected in graphite data. ${details}`;
} else {
this.status = status.FAILED;
this.checkOutput = `Spike detected in graphite data. ${details}`;
}

} catch(err) {
logger.error({ event: `${logEventPrefix}_ERROR`, url: this.sampleUrl }, err);
Expand Down

0 comments on commit 4e29ce7

Please sign in to comment.