use of org.apereo.cas.monitor.Monitor in project cas by apereo.
the class CasCoreMonitorConfiguration method healthCheckMonitor.
@ConditionalOnMissingBean(name = "healthCheckMonitor")
@Bean
public Monitor healthCheckMonitor() {
final Map<String, Monitor> beans = applicationContext.getBeansOfType(Monitor.class, false, true);
final Set<Monitor> monitors = beans.entrySet().stream().map(Map.Entry::getValue).collect(Collectors.toSet());
final int freeMemThreshold = casProperties.getMonitor().getFreeMemThreshold();
if (freeMemThreshold > 0) {
monitors.add(new MemoryMonitor(freeMemThreshold));
}
final MonitorProperties.Warn warn = casProperties.getMonitor().getSt().getWarn();
if (warn.getThreshold() > 0) {
final SessionMonitor bean = new SessionMonitor(ticketRegistry, warn.getThreshold(), warn.getThreshold());
monitors.add(bean);
}
return new HealthCheckMonitor(monitors);
}
Aggregations