@Override public void warnWithError(final String name, final Throwable error) { logger.warn("HealthService::warn() {}", name); super.incrementCount("warn"); final NodeHealthStat nodeHealthStat = getServiceHealthStat(name); nodeHealthStat.setStatus(HealthStatus.WARN); nodeHealthStat.setReason(HealthFailReason.ERROR); nodeHealthStat.setLastCheckIn(super.time); nodeHealthStat.setError(error); onWarn.ifPresent(checkIn -> checkIn.accept(BeanUtils.copy(nodeHealthStat))); }
/** * Fail the node for the service with a specific status. * * @param name name * @param error error */ @Override public void failWithError(final String name, final Throwable error) { logger.error("HealthService::fail() {}", name); super.incrementCount("fail"); final NodeHealthStat nodeHealthStat = getServiceHealthStat(name); nodeHealthStat.setStatus(HealthStatus.FAIL); nodeHealthStat.setReason(HealthFailReason.ERROR); nodeHealthStat.setLastCheckIn(super.time); nodeHealthStat.setError(error); onFail.ifPresent(checkIn -> checkIn.accept(BeanUtils.copy(nodeHealthStat))); }
@Override public void warnWithError(final String name, final Throwable error) { logger.warn("HealthService::warn() {}", name); super.incrementCount("warn"); final NodeHealthStat nodeHealthStat = getServiceHealthStat(name); nodeHealthStat.setStatus(HealthStatus.WARN); nodeHealthStat.setReason(HealthFailReason.ERROR); nodeHealthStat.setLastCheckIn(super.time); nodeHealthStat.setError(error); onWarn.ifPresent(checkIn -> checkIn.accept(BeanUtils.copy(nodeHealthStat))); }
@Override public void warnWithError(final String name, final Throwable error) { logger.warn("HealthService::warn() {}", name); super.incrementCount("warn"); final NodeHealthStat nodeHealthStat = getServiceHealthStat(name); nodeHealthStat.setStatus(HealthStatus.WARN); nodeHealthStat.setReason(HealthFailReason.ERROR); nodeHealthStat.setLastCheckIn(super.time); nodeHealthStat.setError(error); onWarn.ifPresent(checkIn -> checkIn.accept(BeanUtils.copy(nodeHealthStat))); }
/** * Fail the node for the service with a specific status. * * @param name name * @param error error */ @Override public void failWithError(final String name, final Throwable error) { logger.error("HealthService::fail() {}", name); super.incrementCount("fail"); final NodeHealthStat nodeHealthStat = getServiceHealthStat(name); nodeHealthStat.setStatus(HealthStatus.FAIL); nodeHealthStat.setReason(HealthFailReason.ERROR); nodeHealthStat.setLastCheckIn(super.time); nodeHealthStat.setError(error); onFail.ifPresent(checkIn -> checkIn.accept(BeanUtils.copy(nodeHealthStat))); }
/** * Fail the node for the service with a specific status. * * @param name name * @param error error */ @Override public void failWithError(final String name, final Throwable error) { logger.error("HealthService::fail() {}", name); super.incrementCount("fail"); final NodeHealthStat nodeHealthStat = getServiceHealthStat(name); nodeHealthStat.setStatus(HealthStatus.FAIL); nodeHealthStat.setReason(HealthFailReason.ERROR); nodeHealthStat.setLastCheckIn(super.time); nodeHealthStat.setError(error); onFail.ifPresent(checkIn -> checkIn.accept(BeanUtils.copy(nodeHealthStat))); }