class InstanceStateInspector extends BaseAlertService {

    /**
     * 实例相关
     */
    @Autowired
    private InstanceDao instanceDao;
    @Autowired
    private AppService appService;
    @Autowired
    private UserService userService;
    @Autowired
    private Configuration configuration;

    public boolean inspect() {<FILL_FUNCTION_BODY>}

}


        List<InstanceAlertValueResult> alertInstInfo = new ArrayList<>();
        List<InstanceInfo> heartStopInstances = instanceDao.getAllHeartStopInstance();
        if (!CollectionUtils.isEmpty(heartStopInstances)) {
            for (InstanceInfo info : heartStopInstances) {
                long appId = info.getAppId();
                AppDesc appDesc = appService.getByAppId(appId);
                appDesc.setOfficer(userService.getOfficerName(appDesc.getOfficer()));
                InstanceAlertValueResult instanceAlert = new InstanceAlertValueResult();
                instanceAlert.setInstanceInfo(info);
                instanceAlert.setAppId(appId);
                instanceAlert.setAppDesc(appDesc);
                instanceAlert.setOtherInfo(InstanceStatusEnum.getByStatus(info.getStatus()).getInfo());
                alertInstInfo.add(instanceAlert);
            }
            String emailTitle = String.format("Redis实例异常状态监控报警");
            Map<String, Object> context = new HashMap<>();
            context.put("instanceAlertValueResultList", alertInstInfo);
            String emailContent = FreemakerUtils.createText("instanceState.ftl", configuration, context);
            appAlertRecordService.saveAlertInfoByType(AlertTypeEnum.INATANCE_EXCEPTION_STATE_MONITOR, emailTitle, null, alertInstInfo);
            emailComponent.sendMailToAdmin(emailTitle, emailContent);
            logger.info(emailContent);
        }
        return true;
    
<methods>public non-sealed void <init>() <variables>protected com.sohu.cache.web.service.AppAlertRecordService appAlertRecordService,protected com.sohu.cache.alert.EmailComponent emailComponent,protected final org.slf4j.Logger logger,protected com.sohu.cache.alert.WeChatComponent weChatComponent