List of usage examples for org.springframework.boot.actuate.health Health.Builder unknown
public static Builder unknown()
From source file:com.netflix.spinnaker.echo.pipelinetriggers.health.MonitoredPollerHealth.java
private void polledRecently(Health.Builder builder) { Instant lastPollTimestamp = poller.getLastPollTimestamp(); if (lastPollTimestamp == null) { builder.unknown(); } else {/*from ww w . j a v a2s .co m*/ val timeSinceLastPoll = Duration.between(lastPollTimestamp, now()); builder.withDetail("last.polled", formatDurationWords(timeSinceLastPoll.toMillis(), true, true) + " ago"); builder.withDetail("last.polled.at", ISO_LOCAL_DATE_TIME.format(lastPollTimestamp.atZone(ZoneId.systemDefault()))); if (timeSinceLastPoll.compareTo(Duration.of(poller.getPollingIntervalSeconds() * 2, SECONDS)) <= 0) { builder.up(); } else { builder.down(); } } }