use of com.sohu.cache.stats.instance.InstanceAlertValueService in project cachecloud by sohutv.
the class InstanceAlertValueJob method action.
@Override
public void action(JobExecutionContext context) {
try {
long startTime = System.currentTimeMillis();
SchedulerContext schedulerContext = context.getScheduler().getContext();
ApplicationContext applicationContext = (ApplicationContext) schedulerContext.get(APPLICATION_CONTEXT_KEY);
InstanceAlertValueService instanceAlertValueService = applicationContext.getBean("instanceAlertValueService", InstanceAlertValueService.class);
int instanceSize = instanceAlertValueService.monitorLastMinuteAllInstanceInfo();
logger.warn("InstanceAlertValueJob monitor {} instance, costtime {} ms", instanceSize, (System.currentTimeMillis() - startTime));
} catch (SchedulerException e) {
logger.error(e.getMessage(), e);
}
}
Aggregations