This is ApacheBench, Version 2.3 <$Revision: 1430300 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/
Concurrency Level: 10 Time taken for tests: 17.458 seconds Complete requests: 100 Failed requests: 0 Write errors: 0 Total transferred: 1045400 bytes HTML transferred: 1019300 bytes Requests per second: 5.73 [#/sec] (mean) Time per request: 1745.789 [ms] (mean) Time per request: 174.579 [ms] (mean, across all concurrent requests) Transfer rate: 58.48 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 695 951 198.0 925 1629 Processing: 454 582 57.3 596 693 Waiting: 228 293 30.9 298 368 Total: 1152 1533 233.7 1526 2267
Percentage of the requests served within a certain time (ms) 50% 1526 66% 1558 75% 1594 80% 1614 90% 1652 95% 2222 98% 2267 99% 2267 100% 2267 (longest request)
[mysqld] # 开启binary log log-bin=mysql-bin # 设置server_id server-id=1 # For the greatest possible durability and consistency in a replication setup using InnoDB with transactions, you should use innodb_flush_log_at_trx_commit=1 andsync_binlog=1 in the source's my.cnf file innodb_flush_log_at_trx_commit=1 sync_binlog=1
# my global config global: scrape_interval:15s# Set the scrape interval to every 15 seconds. Default is every 1 minute. evaluation_interval:15s# Evaluate rules every 15 seconds. The default is every 1 minute. # scrape_timeout is set to the global default (10s).
# Load rules once and periodically evaluate them according to the global 'evaluation_interval'. rule_files: # - "first_rules.yml" # - "second_rules.yml"
# A scrape configuration containing exactly one endpoint to scrape: # Here it's Prometheus itself. scrape_configs: # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config. -job_name:'prometheus'
# metrics_path defaults to '/metrics' # scheme defaults to 'http'.
// If required, authenticate and set web context authenticateIfRequired(request);
filterChain.doFilter(request, response);
// Clear web context WebContextUtils.clear(); }
/** * Authenticate if required */ privatevoidauthenticateIfRequired(HttpServletRequest request) { Stringtoken= request.getHeader(Common.TOKEN_HEADER_KEY); if (StringUtils.isBlank(token)) { log.debug("no token, as anonymous in later AnonymousAuthenticationFilter"); // // 在过滤链AnonymousAuthenticationFilter中设置为匿名用户 // // 这里要先clear,否则在匿名Filter中会存在JwtTokenAuthenticationToken;具体原因暂时未知 SecurityContextHolder.clearContext(); return; }
// wrap request authentication AuthenticationauthRequest=newJwtTokenAuthenticationToken(token); // authenticate for result (delegate by ProviderManager) AuthenticationauthResult= authenticationManager.authenticate(authRequest); // set to security context SecurityContextHolder.getContext().setAuthentication(authResult); } }
错误信息:feign.codec.EncodeException: No qualifying bean of type ‘org.springframework.boot.autoconfigure.http.HttpMessageConverters’ available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {@org.springframework.beans.factory.annotation.Autowired(required=true)} 原因:OpenFeign与基于WebFlux的Gateway不能完美适配导致报错 解决方案:
1 2 3 4 5
@Bean @ConditionalOnMissingBean public HttpMessageConverters messageConverters(ObjectProvider<HttpMessageConverter<?>> converters) { returnnewHttpMessageConverters(converters.orderedStream().collect(Collectors.toList())); }