public String routerResult()

in src/frontend/src/main/java/com/alibabacloud/hipstershop/web/GracefulShutdownDemoController.java [29:92]


    public String routerResult(Model model) {

        synchronized (SPRING_CLOUD_LOCK) {

            SPRING_CLOUD_RESULT_LIST.clear();
            SPRING_CLOUD_RESULT_MAP.clear();

            for (String str : SPRING_CLOUD_RESULT_QUEUE) {

                if (!"出错了".equals(str)) {
                    str = "success";
                }

                if (null == SPRING_CLOUD_RESULT_MAP.get(str)) {
                    SPRING_CLOUD_RESULT_MAP.put(str, 1);
                } else {
                    int count = SPRING_CLOUD_RESULT_MAP.get(str);
                    count++;
                    SPRING_CLOUD_RESULT_MAP.put(str, count);
                }
            }

            for (Map.Entry<String, Integer> entry : SPRING_CLOUD_RESULT_MAP.entrySet()) {
                SPRING_CLOUD_RESULT_LIST.add(new ResultNode(entry.getKey(), entry.getValue()));
            }


            model.addAttribute("productservice", SPRING_CLOUD_RESULT_LIST);
        }
        synchronized (DUBBO_LOCK) {

            DUBBO_RESULT_LIST.clear();
            DUBBO_RESULT_MAP.clear();

            for (String str : DUBBO_RESULT_QUEUE) {


                if (!"出错了".equals(str)) {
                    str = "success";
                }

                if (null == DUBBO_RESULT_MAP.get(str)) {
                    DUBBO_RESULT_MAP.put(str, 1);
                } else {
                    int count = DUBBO_RESULT_MAP.get(str);
                    count++;
                    DUBBO_RESULT_MAP.put(str, count);
                }
            }

            for (Map.Entry<String, Integer> entry : DUBBO_RESULT_MAP.entrySet()) {
                DUBBO_RESULT_LIST.add(new ResultNode(entry.getKey(), entry.getValue()));
            }


            model.addAttribute("cartservice", DUBBO_RESULT_LIST);
        }

        model.addAttribute("dubbo_invoker_times", DUBBO_INVOKER_TIMES.get());
        model.addAttribute("dubbo_error_times", DUBBO_ERROR_TIMES.get());
        model.addAttribute("spring_cloud_invoker_times", SPRING_CLOUD_INVOKER_TIMES.get());
        model.addAttribute("spring_cloud_error_times", SPRING_CLOUD_ERROR_TIMES.get());
        return "shutdown.html";
    }