性能测试工具

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

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

junitperf

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

特性

  • 支持 Junit4+JDK1.7+,入门简单 (@since 1.0.0)

  • 支持 Junit5+JDK1.8+,使用方便 (@since 2.0.0)

  • 支持 I18N

  • 性能报告支持自定义拓展

使用例子

入门案例

入门案例地址

  • jar 包引入
<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

HTML 形式

java 性能测试框架工具-junitperf的更多相关文章

  1. java集合框架——工具类

    一.概述 JAVA集合框架中有两个很重要的工具类,一个是Collections,另一个是Arrays.分别封装了对集合的操作方法和对数组的操作方法,这些操作方法使得程序员的开发更加高效. public ...

  2. Java 集合框架工具类

    Collections Arrays Collections 集合框架的工具类, 里面的方法都是静态的, 可以直接使用类名调用 常用方法 1. sort(List<T> list); // ...

  3. Java——集合框架 工具

     /* * Arrays工具类的使用 */ public class ArraysTest { public static void main(String[] args) { // TODO A ...

  4. java集合框架工具类Collections,集合的操作

    1 import java.util.*; public class asList { public static void main(String args[]) { // int arr[] = ...

  5. 【JAVA集合框架之工具类】

    一.概述 JAVA集合框架中有两个很重要的工具类,一个是Collections,另一个是Arrays.分别封装了对集合的操作方法和对数组的操作方法,这些操作方法使得程序员的开发更加高效. public ...

  6. JAVA基础学习之 Map集合、集合框架工具类Collections,Arrays、可变参数、List和Set集合框架什么时候使用等(4)

    package com.itcast.test20140113; import java.util.ArrayList; import java.util.Arrays; import java.ut ...

  7. java基础37 集合框架工具类Collections和数组操作工具类Arrays

    一.集合框架工具类:Collections 1.1.Collections类的特点 该工具类中所有的方法都是静态的 1.2.Collections类的常用方法 binarySearch(List< ...

  8. (Set, Map, Collections工具类)JAVA集合框架二

    Java集合框架部分细节总结二 Set 实现类:HashSet,TreeSet HashSet 基于HashCode计算元素存放位置,当计算得出哈希码相同时,会调用equals判断是否相同,相同则拒绝 ...

  9. Java集合框架:Collections工具类

    java.util.Collections工具类提供非常多实用的方法.使得程序员操作集合类的时候更加的方便easy,这些方法都是静态的. 整个Collections工具类源代码几乎相同有4000行.我 ...

随机推荐

  1. CentOS 使用yum命令安装出现错误提示”could not retrieve mirrorlist http://mirrorlist.centos.org

    CentOS 使用yum命令安装出现错误提示"could not retrieve mirrorlist http://mirrorlist.centos.org这个错误, 在网上找了好多, ...

  2. [Leetcode 771]宝石和石子 Jewels and Stones HashSet简单应用

    [题目] You're given strings J representing the types of stones that are jewels, and S representing the ...

  3. noj装载问题

    描述 有两艘船,载重量分别是c1. c2,n个集装箱,重量是wi (i=1…n),且所有集装箱的总重量不超过c1+c2.确定是否有可能将所有集装箱全部装入两艘船.   输入 多个测例,每个测例的输入占 ...

  4. Tex_Err:缺失wlscirep.cls

    使用期刊模板编译时,需要'.cls'一类格式文件支持.从Overleaf上直接Copy代码到本地,发现自己的tex运行时会报错: ! LaTeX Error: File `wlscirep.cls' ...

  5. sklearn.preprocessing.LabelBinarizer

    sklearn.preprocessing.LabelBinarizer

  6. Self-Introduce

    My name is Leo.I like listening music, especially English song.What's more, I enjoy playing games, l ...

  7. hdu5000 Clone dp+大数

    After eating food from Chernobyl, DRD got a super power: he could clone himself right now! He used t ...

  8. 同一个windows server 部署多个tomcat

    只需要修改tomcat目录下conf下的server.xml文件即可,修改地方有三个,把下面这几个端口修改了为不同的端口即可,例如我把这几个端口统一减1了 <Server port=" ...

  9. Linux学习--“杀死”程序

    (cp https://billie66.github.io/TLCL/book/chap11.html) While this is all very straightforward, there ...

  10. java 实现excel 导出功能

    实现功能:java导出excel表 1.jsp代码 <form id="zhanwForm" action="<%=path%>/conferences ...