use of password.pwm.health.HealthMonitor in project pwm by pwm-project.
the class RestHealthServer method processGetHealthCheckData.
public static HealthData processGetHealthCheckData(final PwmApplication pwmApplication, final Locale locale, final boolean refreshImmediate) throws IOException, PwmUnrecoverableException {
final HealthMonitor healthMonitor = pwmApplication.getHealthMonitor();
final HealthMonitor.CheckTimeliness timeliness = determineDataTimeliness(refreshImmediate);
final List<password.pwm.health.HealthRecord> healthRecords = new ArrayList<>(healthMonitor.getHealthRecords(timeliness));
final List<HealthRecord> healthRecordBeans = HealthRecord.fromHealthRecords(healthRecords, locale, pwmApplication.getConfig());
final HealthData healthData = new HealthData();
healthData.timestamp = healthMonitor.getLastHealthCheckTime();
healthData.overall = healthMonitor.getMostSevereHealthStatus(timeliness).toString();
healthData.records = healthRecordBeans;
return healthData;
}
Aggregations