因项目需要,简单了解下性能测试工具。Apache JMeter.
1 加载pom依赖
ApacheJMeter_core,ApacheJMeter_components,ApacheJMeter_http,junit2 配置jmeter.properties
3
public static HTTPSamplerProxy createHTTPSamplerProxy() { HeaderManager headerManager = new HeaderManager(); headerManager.setProperty("Content-Type", "multipart/form-data"); HTTPSamplerProxy httpSamplerProxy = new HTTPSamplerProxy(); httpSamplerProxy.addArgument("name", "hhhhhh"); httpSamplerProxy.addArgument("id", "1200"); httpSamplerProxy.setDomain("127.0.0.1"); httpSamplerProxy.setPort(8011); httpSamplerProxy.setPath("/sql/hh"); httpSamplerProxy.setMethod("GET"); httpSamplerProxy.setConnectTimeout("5000"); httpSamplerProxy.setUseKeepAlive(true); httpSamplerProxy.setProperty(TestElement.TEST_CLASS, HTTPSamplerProxy.class.getName()); httpSamplerProxy.setHeaderManager(headerManager); return httpSamplerProxy; }4 本地启动SpringBoot项目,8011端口,拦截看参数是否传递过去。