Skip to content

Commit e49de44

Browse files
author
yangjiaqi
committed
enhance code logic
1 parent 5b087d6 commit e49de44

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

hugegraph-server/hugegraph-api/src/main/java/org/apache/hugegraph/api/filter/AccessLogFilter.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public void filter(ContainerRequestContext requestContext,
116116
String metricsName = join(path, method);
117117

118118
int status = responseContext.getStatus();
119-
if (status != 500 && status != 415) {
119+
if (isStatusXx(status)) {
120120
MetricsUtil.registerCounter(join(metricsName, METRICS_PATH_TOTAL_COUNTER)).inc();
121121
}
122122

@@ -164,4 +164,8 @@ public void filter(ContainerRequestContext requestContext,
164164
private boolean statusOk(int status) {
165165
return status >= 200 && status < 300;
166166
}
167+
168+
private boolean isStatusXx(int status) {
169+
return status != 500 && status != 415;
170+
}
167171
}

0 commit comments

Comments
 (0)