编程语言
首页 > 编程语言> > java 性能测试框架工具-junitperf

java 性能测试框架工具-junitperf

作者:互联网

性能测试工具

 

对于 Java 开发者来说,要去学习性能测试工具未免很麻烦。

 

但有时候会有性能测试的需求。

 

junitperf

 

junitperf 就是一款为 Java 开发者设计的性能测试框架,如果你会 Junit,很容易就可以学会。

 

特性

 

 

使用例子

 

入门案例

 

入门案例地址

 

1 <dependency>
2     <groupId>com.github.houbb</groupId>
3     <artifactId>junitperf</artifactId>
4     <version>2.0.0</version>
5 </dependency>
 1 import com.github.houbb.junitperf.core.annotation.JunitPerfConfig;
 2 
 3 public class HelloWorldTest {
 4 
 5     @JunitPerfConfig(duration = 1000)
 6     public void helloTest() throws InterruptedException {
 7         Thread.sleep(100);
 8         System.out.println("Hello Junit5");
 9     }
10 
11 }

测试结果

 

日志形式

 1 [INFO] 2018-01-14 22:16:31.419 [] - Started at:   2018-01-14 22:16:30.194
 2 [INFO] 2018-01-14 22:16:31.419 [] - Invocations:  10
 3 [INFO] 2018-01-14 22:16:31.420 [] - Success:  10
 4 [INFO] 2018-01-14 22:16:31.420 [] - Errors:   0
 5 [INFO] 2018-01-14 22:16:31.420 [] - Thread Count: 2
 6 [INFO] 2018-01-14 22:16:31.421 [] - Warm up:      0ms
 7 [INFO] 2018-01-14 22:16:31.421 [] - Execution time: 1000ms
 8 [INFO] 2018-01-14 22:16:31.421 [] - Throughput:     10/s (Required: -1/s) - PASSED
 9 [INFO] 2018-01-14 22:16:31.424 [] - Min latency:   200.2112ms (Required: -1.0ms) - PASSED
10 [INFO] 2018-01-14 22:16:31.424 [] - Max latency:    205.67862ms (Required: -1.0ms) - PASSED
11 [INFO] 2018-01-14 22:16:31.425 [] - Ave latency:    202.97829ms (Required: -1.0ms) - PASSED

HTML 形式

 

标签:INFO,01,java,框架,22,16,junitperf,2018,14
来源: https://www.cnblogs.com/kejimao/p/14764507.html