for stress test

This commit is contained in:
hongqiaowei
2021-05-08 17:08:17 +08:00
parent ace37ed76f
commit 7cbd98f193
2 changed files with 11 additions and 9 deletions

View File

@@ -48,12 +48,14 @@ public class FizzLogFilter implements WebFilter {
long startTime = System.currentTimeMillis();
return chain.filter(exchange).doAfterTerminate(
() -> {
if (LOGGER.isInfoEnabled()) {
StringBuilder b = ThreadContext.getStringBuilder();
WebUtils.request2stringBuilder(exchange, b);
b.append(resp).append(exchange.getResponse().getStatusCode())
.append(in) .append(System.currentTimeMillis() - startTime);
LOGGER.info(b.toString(), LogService.BIZ_ID, exchange.getRequest().getId());
}
}
);
}
}

View File

@@ -71,7 +71,7 @@ public class PreprocessFilter extends FizzWebFilter {
@Override
public Mono<Void> doFilter(ServerWebExchange exchange, WebFilterChain chain) {
Map<String, FilterResult> fc = new HashMap<>(6, 1.0f); fc.put(WebUtils.PREV_FILTER_RESULT, succFr);
Map<String, FilterResult> fc = new HashMap<>(12, 1.0f); fc.put(WebUtils.PREV_FILTER_RESULT, succFr);
Map<String, String> appendHdrs = new HashMap<>(6, 1.0f);
Map<String, Object> eas = exchange.getAttributes(); eas.put(WebUtils.FILTER_CONTEXT, fc);
eas.put(WebUtils.APPEND_HEADERS, appendHdrs);