Jmeter-如何获取SLA度量
是否存在从UI计算jmeter中SLA下的请求数的方法?例如,响应时间<400毫秒的请求计数Jmeter-如何获取SLA度量,jmeter,jmeter-plugins,Jmeter,Jmeter Plugins,是否存在从UI计算jmeter中SLA下的请求数的方法?例如,响应时间
elapsed,label
423,sampler1
452,sampler2
958,sampler1
152,sampler1
long responseTime = sampleResult.getEndTime() - sampleResult.getStartTime();
if(responseTime < 400) {
FileOutputStream f = new FileOutputStream("myreport.csv", true);
PrintStream p = new PrintStream(f);
this.interpreter.setOut(p);
print(sampleResult.getSampleLabel() + "," + responseTime);
f.close();
}
从这里,您可以将其带到任何其他工具(awk、Excel等)以筛选所需的结果elapsed,label
423,sampler1
452,sampler2
958,sampler1
152,sampler1
long responseTime = sampleResult.getEndTime() - sampleResult.getStartTime();
if(responseTime < 400) {
FileOutputStream f = new FileOutputStream("myreport.csv", true);
PrintStream p = new PrintStream(f);
this.interpreter.setOut(p);
print(sampleResult.getSampleLabel() + "," + responseTime);
f.close();
}
long responseTime=sampleResult.getEndTime()-sampleResult.getStartTime();
如果(响应时间<400){
FileOutputStream f=新的FileOutputStream(“myreport.csv”,true);
打印流p=新打印流(f);
本.解释.出发(p);
打印(sampleResult.getSampleLabel()+“,”+响应时间);
f、 close();
}
但是,如果您计划对多个(超过200-300个)用户和多个“适合”过滤器的操作运行压力测试,那么这种方法的性能可能不够elapsed,label
423,sampler1
452,sampler2
958,sampler1
152,sampler1
long responseTime = sampleResult.getEndTime() - sampleResult.getStartTime();
if(responseTime < 400) {
FileOutputStream f = new FileOutputStream("myreport.csv", true);
PrintStream p = new PrintStream(f);
this.interpreter.setOut(p);
print(sampleResult.getSampleLabel() + "," + responseTime);
f.close();
}
从这里,您可以将其带到任何其他工具(awk、Excel等)以筛选所需的结果elapsed,label
423,sampler1
452,sampler2
958,sampler1
152,sampler1
long responseTime = sampleResult.getEndTime() - sampleResult.getStartTime();
if(responseTime < 400) {
FileOutputStream f = new FileOutputStream("myreport.csv", true);
PrintStream p = new PrintStream(f);
this.interpreter.setOut(p);
print(sampleResult.getSampleLabel() + "," + responseTime);
f.close();
}
long responseTime=sampleResult.getEndTime()-sampleResult.getStartTime();
如果(响应时间<400){
FileOutputStream f=新的FileOutputStream(“myreport.csv”,true);
打印流p=新打印流(f);
本.解释.出发(p);
打印(sampleResult.getSampleLabel()+“,”+响应时间);
f、 close();
}
但是,如果您计划对多个(超过200-300个)用户和多个“适合”过滤器的操作运行压力测试,那么这种方法的性能可能不够不久前我遇到了一个类似的问题,并编写了一个小工具-请参见我不久前遇到了一个类似的问题,并编写了一个小工具-请参见JMeter为OOTB提供了一个Web报告,该报告提供了大量有关负载测试的信息,这些信息使用了标准度量,如APDEX、百分位数 见此:
在报告中,您将获得满足此SLA标准的成功请求数。JMeter提供OOTB一个Web报告,该报告使用APDEX、Percentiles 见此: