diff --git a/rxlib/src/main/java/org/rx/spring/MxController.java b/rxlib/src/main/java/org/rx/spring/MxController.java index a6b95f05..ebf3add9 100644 --- a/rxlib/src/main/java/org/rx/spring/MxController.java +++ b/rxlib/src/main/java/org/rx/spring/MxController.java @@ -141,7 +141,10 @@ public Object health(HttpServletRequest request) { } @RequestMapping("health/p") - public void healthP(HttpServletRequest request, HttpServletResponse response) { + public Object healthP(HttpServletRequest request, HttpServletResponse response) { + if ("1".equals(request.getParameter("mock"))) { + return 1; + } String fu = request.getParameter("fu"); Integer tm = Reflects.convertQuietly(request.getParameter("tm"), Integer.class); HttpClient client = new HttpClient(); @@ -149,6 +152,7 @@ public void healthP(HttpServletRequest request, HttpServletResponse response) { client.withTimeoutMillis(tm); } client.forward(request, response, fu); + return null; } // @SneakyThrows @@ -206,9 +210,7 @@ Map findTopUsage(Date begin, Date end) { return result; } - Map queryTraces(Date startTime, Date endTime, String level, String keyword, Boolean newest, - Boolean methodOccurMost, String methodNamePrefix, String metricsName, - Integer take) { + Map queryTraces(Date startTime, Date endTime, String level, String keyword, Boolean newest, Boolean methodOccurMost, String methodNamePrefix, String metricsName, Integer take) { Map result = new LinkedHashMap<>(3); ExceptionLevel el = null; if (!Strings.isBlank(level)) { @@ -281,9 +283,7 @@ Map svrState(HttpServletRequest request) { j.put("rxConfig", RxConfig.INSTANCE); j.put("requestHeaders", Linq.from(Collections.list(request.getHeaderNames())).select(p -> String.format("%s: %s", p, String.join("; ", Collections.list(request.getHeaders(p)))))); - j.putAll(queryTraces(null, null, null, null, null, - null, null, null, - take)); + j.putAll(queryTraces(null, null, null, null, null, null, null, null, take)); return j; }