}
@Override
public HealthDetailResponse getDetailedHealthStatus(RequestContext reqCtx, TimeConstraints timeConstraints) throws HealthException {
HealthDetailResponse detail = new HealthDetailResponse();
List<SubComponentStatus> subStatuses = new ArrayList<>();
for (Monitor m : monitorRegistry.getMonitorSet()) {
SubComponentStatus scs = new SubComponentStatus();
scs.setName(m.getName());
Status monitorStatus = m.getStatus();
scs.setStatus(getHealthStatus(monitorStatus));
subStatuses.add(scs);
}
detail.setSubComponentList(subStatuses);
if (!isSystemInService()) {
detail.setHealth(HealthStatus.OUT_OF_SERVICE);
} else {
detail.setHealth(getHealthStatus(monitorRegistry.getStatusAggregator().getStatus()));
}
return detail;
}