标签:success ons ogr 性能测试 artifact 特性 code 测试框架 duration
性能测试工具对于 Java 开发者来说,要去学习性能测试工具未免很麻烦。
但有时候会有性能测试的需求。
junitperf 就是一款为 Java 开发者设计的性能测试框架,如果你会 Junit,很容易就可以学会。
支持 Junit4+JDK1.7+,入门简单 (@since 1.0.0)
支持 Junit5+JDK1.8+,使用方便 (@since 2.0.0)
支持 I18N
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>junitperf</artifactId>
<version>2.0.0</version>
</dependency>
import com.github.houbb.junitperf.core.annotation.JunitPerfConfig;
public class HelloWorldTest {
@JunitPerfConfig(duration = 1000)
public void helloTest() throws InterruptedException {
Thread.sleep(100);
System.out.println("Hello Junit5");
}
}
[INFO] 2018-01-14 22:16:31.419 [] - Started at: 2018-01-14 22:16:30.194
[INFO] 2018-01-14 22:16:31.419 [] - Invocations: 10
[INFO] 2018-01-14 22:16:31.420 [] - Success: 10
[INFO] 2018-01-14 22:16:31.420 [] - Errors: 0
[INFO] 2018-01-14 22:16:31.420 [] - Thread Count: 2
[INFO] 2018-01-14 22:16:31.421 [] - Warm up: 0ms
[INFO] 2018-01-14 22:16:31.421 [] - Execution time: 1000ms
[INFO] 2018-01-14 22:16:31.421 [] - Throughput: 10/s (Required: -1/s) - PASSED
[INFO] 2018-01-14 22:16:31.424 [] - Min latency: 200.2112ms (Required: -1.0ms) - PASSED
[INFO] 2018-01-14 22:16:31.424 [] - Max latency: 205.67862ms (Required: -1.0ms) - PASSED
[INFO] 2018-01-14 22:16:31.425 [] - Ave latency: 202.97829ms (Required: -1.0ms) - PASSED
标签:success ons ogr 性能测试 artifact 特性 code 测试框架 duration
原文地址:http://blog.51cto.com/9250070/2149264