Commit 895fceeb9e0f6f36cd5a1fd5a6a46bcd91b2624b
1 parent
d070740baf
Exists in
master
and in
6 other branches
SmsConfigModel 过滤掉不同步
Showing 1 changed file with 10 additions and 1 deletions
platform-common/src/main/java/com/lyms/platform/common/perf/SimpleHttpPerfFilter.java
View file @
895fcee
... | ... | @@ -13,6 +13,7 @@ |
13 | 13 | import javax.servlet.ServletResponse; |
14 | 14 | import javax.servlet.http.HttpServletRequest; |
15 | 15 | |
16 | +import org.apache.commons.lang.math.NumberUtils; | |
16 | 17 | import org.slf4j.Logger; |
17 | 18 | import org.slf4j.LoggerFactory; |
18 | 19 | |
... | ... | @@ -30,6 +31,8 @@ |
30 | 31 | */ |
31 | 32 | private List<String> fixUri = new ArrayList<String>(); |
32 | 33 | |
34 | + private int threshold; | |
35 | + | |
33 | 36 | @Override |
34 | 37 | public void destroy() { |
35 | 38 | fixUri.clear(); |
... | ... | @@ -44,7 +47,12 @@ |
44 | 47 | arg2.doFilter(arg0, arg1); |
45 | 48 | long end = System.currentTimeMillis(); |
46 | 49 | String queryStr = getRequestUrl((HttpServletRequest) arg0); |
47 | - logger.info(queryStr + " costTime " + (end - start) + "ms."); | |
50 | + long cost= (end - start); | |
51 | + if(threshold>=cost){ | |
52 | + logger.info(queryStr + " costTime " + (end - start) + "ms."); | |
53 | + }else { | |
54 | + logger.warn(queryStr + " costTime " + (end - start) + "ms."); | |
55 | + } | |
48 | 56 | } |
49 | 57 | } |
50 | 58 | |
... | ... | @@ -71,6 +79,7 @@ |
71 | 79 | if (null != fixNames) { |
72 | 80 | fixUri.addAll(Arrays.asList(fixNames.split(","))); |
73 | 81 | } |
82 | + threshold = NumberUtils.toInt(arg0.getInitParameter("threshold"),1000); | |
74 | 83 | } |
75 | 84 | |
76 | 85 | /** |