Coder Social home page Coder Social logo

jperf's Introduction

JPerf is a simple performance and scalability testing framework for Java. Think of it as JUnit for performance tests.

JPerf is distributed under the Apache License 2.0 (see LICENSE.txt).

The latest version can be downloaded from https://github.com/codefutures/jperf/releases

JPerf can be used programmatically or from the command line to run scalability tests again any class implementing the PerfTest interface.

Programmatic use:

// create config
PerfTestConfig config = JPerf.newConfigBuilder()
    .minThreads(1)
    .maxThreads(10)
    .duration(100)
    .testFactory(() -> new EmptyTest())
    .build();

// run test
JPerf.run(config);

Command-line use:

usage: jperf [-class <arg>] [-duration <arg>] [-increment <arg>] [-max
       <arg>] [-min <arg>]
 -class <arg>       Name of class that implemented org.jperf.PerfTest
 -duration <arg>    The duration in milliseconds (per thread level)
 -increment <arg>   The number of threads to increment by
 -max <arg>         The maximum number of threads to test with
 -min <arg>         The number of threads to start testing with

All arguments are optional, except for 'class'.

Example of command line use:

java -classpath yourclasspathhere org.jperf.JPerf -class org.jperf.noop.NoOpTest

In either case, output similar to the following will be written to stdout.

Running on Nov 9, 2014 11:15:39 AM with config: PerfTestConfig{minThreads=1, maxThreads=10, threadIncrement=1, duration=1000}
With 1 threads there were 200,382,238 samples
With 2 threads there were 390,074,461 samples
With 3 threads there were 304,151,933 samples
With 4 threads there were 277,960,408 samples
With 5 threads there were 231,347,787 samples
With 6 threads there were 180,998,431 samples
With 7 threads there were 172,647,235 samples
With 8 threads there were 145,501,665 samples
With 9 threads there were 135,152,189 samples
With 10 threads there were 124,737,834 samples
Stopping threads
Finished

JPerf has dependencies on the following open source projects:

  • Apache CLI
  • Google Guava

Copyright (C) 2007-2014 CodeFutures

jperf's People

Contributors

andygrove avatar avantgardnerio avatar

Watchers

hxping7 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.