class AnalysisController extends BaseController {

    @Autowired
    private AssistRedisService assistRedisService;

    @Autowired
    private InstanceBigKeyDao instanceBigKeyDao;

    @Autowired
    private TaskService taskService;

    @Autowired
    private AppAuditDao appAuditDao;

    @Autowired
    private AppEmailUtil appEmailUtil;

    /**
     * key分析
     */
    @RequestMapping("/admin/app/key")
    public ModelAndView appKey(Model model, Long appId) {
        AppDesc appDesc = appService.getByAppId(appId);
        model.addAttribute("appDesc", appDesc);
        List<AppAudit> appAuditList = appService.getAppAudits(appId, AppAuditType.KEY_ANALYSIS.getValue());
        model.addAttribute("appAuditList", appAuditList);
        return new ModelAndView("analysis/appKey");
    }

    /**
     * 提交前置键值分析申请
     *
     * @param appId 应用id
     */
    @RequestMapping(value = "/admin/app/keyAnalysis")
    public ModelAndView submitKeyAnalysis(HttpServletRequest request,
                                          HttpServletResponse response, Long appId, String nodeInfo, String appAnalysisReason) {
        try {
            AppUser appUser = getUserInfo(request);
            AppDesc appDesc = appService.getByAppId(appId);
            AppAudit appAudit = appService.saveAppKeyAnalysis(appDesc, appUser, appAnalysisReason, nodeInfo);
            appEmailUtil.noticeAppResult(appDesc, appAudit);
            write(response, String.valueOf(SuccessEnum.SUCCESS.value()));
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            write(response, String.valueOf(SuccessEnum.FAIL.value()));
        }
        return null;
    }

    /**
     * key分析结果
     */
    @RequestMapping("/admin/app/keyAnalysisResult")
    public ModelAndView keyAnalysisResult(Model model, Long appId, long auditId) {<FILL_FUNCTION_BODY>}

    /**
     * 审批执行键值分析
     */
    @RequestMapping(value = "/manage/app/startKeyAnalysis")
    public ModelAndView startKeyAnalysis(HttpServletRequest request) {
        long appId = NumberUtils.toLong(request.getParameter("appId"));
        long auditId = NumberUtils.toLong(request.getParameter("appAuditId"));
        appAuditDao.updateAppAuditOperateUser(auditId, getUserInfo(request).getId());
        long taskId = taskService.addAppKeyAnalysisTask(appId, auditId, 0);
        return new ModelAndView("redirect:/manage/task/flow?taskId=" + taskId);
    }

}

        AppDesc appDesc = appService.getByAppId(appId);
        model.addAttribute("appDesc", appDesc);

        //idle
        String idleKeyResultKey = ConstUtils.getRedisServerIdleKey(appId, auditId);
        Set<Tuple> idleKeyTuples = assistRedisService.zrangeWithScores(idleKeyResultKey, 0, -1);
        List<ParamCount> idleKeyParamCountList = new ArrayList<ParamCount>();
        for (Tuple tuple : idleKeyTuples) {
            String element = tuple.getElement();
            IdleTimeDistriEnum idleTimeDistriEnum = IdleTimeDistriEnum.getByValue(element);
            ParamCount paramCount = new ParamCount(idleTimeDistriEnum.getInfo(), tuple.getScore(), "");
            idleKeyParamCountList.add(paramCount);
        }
        model.addAttribute("idleKeyParamCountList", idleKeyParamCountList);
        model.addAttribute("idleKeyDistri", JSONArray.fromObject(idleKeyParamCountList));

        //type
        String keyTypeResultKey = ConstUtils.getRedisServerTypeKey(appId, auditId);
        Set<Tuple> keyTypeTuples = assistRedisService.zrangeWithScores(keyTypeResultKey, 0, -1);
        List<ParamCount> keyTypeParamCountList = new ArrayList<ParamCount>();
        for (Tuple tuple : keyTypeTuples) {
            ParamCount paramCount = new ParamCount(tuple.getElement(), tuple.getScore(), "");
            keyTypeParamCountList.add(paramCount);
        }
        model.addAttribute("keyTypeParamCountList", keyTypeParamCountList);
        model.addAttribute("keyTypeDistri", JSONArray.fromObject(keyTypeParamCountList));

        //ttl
        String keyTtlResultKey = ConstUtils.getRedisServerTtlKey(appId, auditId);
        Set<Tuple> keyTtlTuples = assistRedisService.zrangeWithScores(keyTtlResultKey, 0, -1);
        List<ParamCount> keyTtlParamCountList = new ArrayList<ParamCount>();
        for (Tuple tuple : keyTtlTuples) {
            String element = tuple.getElement();
            TtlTimeDistriEnum ttlTimeDistriEnum = TtlTimeDistriEnum.getByValue(element);
            ParamCount paramCount = new ParamCount(ttlTimeDistriEnum.getInfo(), tuple.getScore(), "");
            keyTtlParamCountList.add(paramCount);
        }
        model.addAttribute("keyTtlParamCountList", keyTtlParamCountList);
        model.addAttribute("keyTtlDistri", JSONArray.fromObject(keyTtlParamCountList));

        //key value size
        String keyValueSizeResultKey = ConstUtils.getRedisServerValueSizeKey(appId, auditId);
        Set<Tuple> keyValueSizeTuples = assistRedisService.zrangeWithScores(keyValueSizeResultKey, 0, -1);
        List<ParamCount> keyValueSizeParamCountList = new ArrayList<ParamCount>();
        for (Tuple tuple : keyValueSizeTuples) {
            String element = tuple.getElement();
            ValueSizeDistriEnum valueSizeDistriEnum = ValueSizeDistriEnum.getByValue(element);
            ParamCount paramCount = new ParamCount(valueSizeDistriEnum.getInfo(), tuple.getScore(), "");
            keyValueSizeParamCountList.add(paramCount);
        }
        model.addAttribute("keyValueSizeParamCountList", keyValueSizeParamCountList);
        model.addAttribute("keyValueSizeDistri", JSONArray.fromObject(keyValueSizeParamCountList));

        //big
        List<InstanceBigKey> instanceBigKeyList = instanceBigKeyDao.getAppBigKeyList(appId, auditId, null);
        model.addAttribute("instanceBigKeyCount", instanceBigKeyList.size());
        instanceBigKeyList = instanceBigKeyList.subList(0, Math.min(instanceBigKeyList.size(), 100));
        model.addAttribute("instanceBigKeyList", instanceBigKeyList);

        return new ModelAndView("analysis/keyAnalysis");
    
<methods>public non-sealed void <init>() ,public boolean clearTempResource(java.lang.String) ,public java.lang.String getTempResource(java.lang.String) ,public com.sohu.cache.entity.AppUser getUserInfo(javax.servlet.http.HttpServletRequest) ,public java.lang.String markdown2html(java.lang.String, java.lang.String) throws java.lang.Exception,public byte[] read(java.io.InputStream) throws java.io.IOException,public java.lang.Boolean saveTempResource(java.lang.String, java.lang.String) ,public void sendMessage(javax.servlet.http.HttpServletResponse, java.lang.String) <variables>protected com.sohu.cache.dao.AppAuditDao appAuditDao,protected com.sohu.cache.dao.AppAuditLogDao appAuditLogDao,protected com.sohu.cache.stats.app.AppDeployCenter appDeployCenter,protected com.sohu.cache.web.util.AppEmailUtil appEmailUtil,protected com.sohu.cache.dao.AppImportDao appImportDao,protected com.sohu.cache.web.service.AppService appService,protected com.sohu.cache.stats.app.AppStatsCenter appStatsCenter,com.sohu.cache.redis.AssistRedisService assistRedisService,protected com.sohu.cache.async.AsyncService asyncService,protected com.sohu.cache.dao.InstanceDao instanceDao,protected com.sohu.cache.stats.instance.InstanceDeployCenter instanceDeployCenter,protected final org.slf4j.Logger logger,protected com.sohu.cache.machine.MachineCenter machineCenter,protected com.sohu.cache.redis.RedisCenter redisCenter,protected com.sohu.cache.redis.RedisConfigTemplateService redisConfigTemplateService,protected com.sohu.cache.redis.RedisDeployCenter redisDeployCenter,protected com.sohu.cache.web.service.ResourceService resourceService,protected com.sohu.cache.web.service.UserLoginStatusService userLoginStatusService,protected com.sohu.cache.web.service.UserService userService