Skip to content
Rhino: Dockerized Distributed Load and Performance Testing Framework
Java Other
  1. Java 99.8%
  2. Other 0.2%
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

Rhino: Dockerized Load and Performance Testing for Web Services

Rhino is a lightweight annotation-based JUnit-style load and performance testing framework tailored for testing web services which consists of the Rhino Java SDK as well as a collection of libraries and tools which enable developers to develop load and performance tests very fast. The Rhino can be added as library dependency into your project or the Rhino Maven archetype can be used to create a new maven project. The deployable artifact will be a Docker container which can be run on container orchestration platforms like Mesos, Kubernetes, AWS ECS, and so on.

1.5.0: Grafana/InfluxDB Integration is included!

With Influx DB and Grafana Integration, you can also monitor the current load testing and watch how services under test behaves under certain load pattern.

Rhino's philosophy is:

  • one repository for project's source code as well as Unit, Integration, Load and Performance Tests.
  • to speed up load and performance test development,
  • to afford a debuggable test framework written in Java, so that you can go through the breakpoints while investigating problems in your load testing code,
  • to provide a Cloud-native load testing environment, that is elastic, scalable, covering region and environment- aware load scenarios,
  • to enable the integration with the existing code, e.g your integration test frameworks to make them reusable in your load and performance test,
  • to provide an intuitive framework so that the engineers do not need to re-learn the language, or the framework every time they need to write new load tests.

Considering all these aspects, we began with Project Rhino in 2018 and it is available as F/OSS with Apache 2.0 License, now.

How to use?

Add maven dependency into your project:

<dependency>
  <groupId>io.ryos.rhino</groupId>
  <artifactId>rhino-core</artifactId>
  <version>1.8.2</version>
</dependency>

For more information about project setup: Getting Started with Rhino Load Testing.

How do the load tests look like?

Simulation is a test entity which will be executed and generates load according to the implementation provided in the test classes against the instance under test, e.g a web service. So as to create a new simulation entity, create a plain Java object with @Simulation annotation:

@Simulation(name = "Example Simulation")
public class PerformanceTestingExample {
}

The simulation above does nothing unless we add some scenarios to it. A scenario is a method annotated with @Scenario annotation and contains the implementation of the load generation. A simulation might have multiple scenarios defined which are run during testing, independently and parallel:

@Simulation(name = "Server-Status Simulation")
@UserRepository(factory = OAuthUserRepositoryFactory.class)
public class RhinoEntity {
  
  // Some http client
  private Client client = ClientBuilder.newClient();

  @Provider(factory = UUIDProvider.class)
  private String uuid;

  @Scenario(name = "Health")
  public void performHealth(final Measurement measurement) {
    var response = client
            .target(TARGET)
            .request()
            .header(X_REQUEST_ID, "Rhino-" + uuid)
            .get();

    measurement.measure("Health API Call", response.getStatus());
  }
}

The name of the simulation is important. In a performance testing project, it is very likely that you will have multiple simulations. Rhino does know which simulation is to be run from the simulation name provided, so the names must be unique.

A simple Rhino application would look like:

import io.ryos.rhino.sdk.Simulation;

public class Rhino {

    private static final String PROPS = "classpath:///rhino.properties";
    private static final String SIM_NAME = "Server-Status Simulation";

    public static void main(String ... args) {
        Simulation.create(PROPS, SIM_NAME).start();
    }
}

Simulations and Scenarios

How to run?

If you choose to use the Rhino archetype, the maven project is configured to create a Docker container:

$ mvn -e clean install
$ docker run -t yourproject:latest

Getting Started

If you think that the Rhino is the right framework for you, you can follow the wiki to get started:

Integrations

Questions/Contributions?

Feel free to fork the project and make contributions in terms of Pull Requests. For bigger proposals, architectural discussions and bug reports, use the Github's issue tracker.

You can’t perform that action at this time.