Skip to content

Commit

Permalink
Merge pull request #112 from tomaslin/fix-healthcheck-poller-names
Browse files Browse the repository at this point in the history
fix poller names in health check
  • Loading branch information
tomaslin authored Jun 16, 2016
2 parents bd7ced7 + 9271910 commit 2cbe72a
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,17 @@ public class PollingMonitorHealth implements HealthIndicator {
pollers.forEach { poller ->
if (poller.isInService()) {
if (poller.lastPoll == null) {
healths << Health.unknown().withDetail('${poller.name}.status', 'not polling yet').build()
healths << Health.unknown().withDetail("${poller.name}.status", 'not polling yet').build()
} else {
// Check if twice the polling interval has elapsed.
if (System.currentTimeMillis() - poller.lastPoll > (poller.pollInterval * 2 * DateTimeConstants.MILLIS_PER_SECOND)) {
healths << Health.down().withDetail('${poller.name}.status', 'stopped').withDetail('${poller.name}.lastPoll', poller.lastPoll.toString()).build()
healths << Health.down().withDetail("${poller.name}.status", 'stopped').withDetail("${poller.name}.lastPoll", poller.lastPoll.toString()).build()
} else {
healths << Health.up().withDetail('${poller.name}.status', 'running').withDetail('${poller.name}.lastPoll', poller.lastPoll.toString()).build()
healths << Health.up().withDetail("${poller.name}.status", 'running').withDetail("${poller.name}.lastPoll", poller.lastPoll.toString()).build()
}
}
} else {
healths << Health.unknown().withDetail('${poller.name}.status', 'not in service').build()
healths << Health.unknown().withDetail("${poller.name}.status", 'not in service').build()
}

}
Expand Down

0 comments on commit 2cbe72a

Please sign in to comment.