Continuous Perf Test

Measuring performance of HTTP call handling

License

License

GNU General Public License v3.0
Categories

Categories

Java Languages
GroupId

GroupId

com.github.continuousperftest
ArtifactId

ArtifactId

agent-java
Last Version

Last Version

1.0.0
Release Date

Release Date

Type

Type

jar
Description

Description

Continuous Perf Test
Measuring performance of HTTP call handling
Project URL

Project URL

https://github.com/continuousperftest/agent-java
Project Organization

Project Organization

Continuous Perf Test
Source Code Management

Source Code Management

https://github.com/continuousperftest/agent-java

Download agent-java

How to add to project

<!-- https://jarcasting.com/artifacts/com.github.continuousperftest/agent-java/ -->
<dependency>
    <groupId>com.github.continuousperftest</groupId>
    <artifactId>agent-java</artifactId>
    <version>1.0.0</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.continuousperftest/agent-java/
implementation 'com.github.continuousperftest:agent-java:1.0.0'
// https://jarcasting.com/artifacts/com.github.continuousperftest/agent-java/
implementation ("com.github.continuousperftest:agent-java:1.0.0")
'com.github.continuousperftest:agent-java:jar:1.0.0'
<dependency org="com.github.continuousperftest" name="agent-java" rev="1.0.0">
  <artifact name="agent-java" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.continuousperftest', module='agent-java', version='1.0.0')
)
libraryDependencies += "com.github.continuousperftest" % "agent-java" % "1.0.0"
[com.github.continuousperftest/agent-java "1.0.0"]

Dependencies

compile (7)

Group / Artifact Type Version
commons-io : commons-io jar 2.6
org.aeonbits.owner : owner jar 1.0.10
com.google.code.gson : gson jar 2.8.5
org.springframework : spring-web jar 5.0.8.RELEASE
org.testng : testng jar 6.14.3
org.apache.httpcomponents : httpclient jar 4.5.6
org.aspectj : aspectjrt jar 1.8.13

Project Modules

There are no modules declared in this project.

Continuous Perf Test agent

Build Status



About the Continuous Perf Test

Continuous Perf Test is about measuring performance of HTTP calls handling that are emitted from test frameworks made up of HTTP clients and xUnit frameworks to give Quality Assurance Engineers an idea of how a system under test (web service) operates from performance standpoint from a release to a release while running a suite of functional automated tests against the system under test. The detailed information about Continuous Perf Test could be found here.

Support

As of now, Continuous Perf Test agent supports the following HTTP clients and xUnit frameworks:

If you would like to utilize the library and something needed is not supported yet, feel free to request it using github issues tracker

Maven:

Dependency

Add to POM.xml

<dependency>
    <groupId>com.github.continuousperftest</groupId>
    <artifactId>agent-java</artifactId>
    <version>1.0.0</version>
</dependency>

Surefire Plugin

If you are running automated tests using maven surefire plugin, it is required to update maven-surefire-plugin section in POM.xml

<properties>
	<maven-surefire-plugin>2.9</maven-surefire-plugin>
	<aspectj.version>1.8.13</aspectj.version>
</properties>
	
<plugins>
    [...]
	<plugin>
		<groupId>org.apache.maven.plugins</groupId>
		<artifactId>maven-surefire-plugin</artifactId>
		<version>${surefire.plugin.version}</version>
		<configuration>
			<argLine>-XX:-UseSplitVerifier</argLine>
			<argLine>-javaagent:${user.home}/.m2/repository/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar</argLine>
			<systemPropertyVariables>
				<project.build.directory>${project.build.directory}</project.build.directory>
			</systemPropertyVariables>
		</configuration>
		<dependencies>
			<dependency>
				<groupId>org.aspectj</groupId>
				<artifactId>aspectjweaver</artifactId>
				<version>${aspectj.version}</version>
			</dependency>
		</dependencies>
	</plugin>
    [...]
</plugins>

Launch parameters

Parameters Default value Description
perf-test.isEnabled false - {true, false} Turns on metrics collection if true is specified
perf-test.exporter local - {local, remote, opted} Chooses a mode for reporting collected metric
perf-test.results.host http://127.0.0.1:8095 Host where collected metrics are sent to if the exporter is set to remote
perf-test.results.directory perf-test-results Folder name where collected metrics are stored if the exporter is set to local

Launch parameters can be set using the following ways depending upon how you launch your automated tests:

  • If you use Maven to run your automated tests you can utilize Maven CLI option such as -D to set values to parameters, for instance, mvn clean test -Dperf-test.isEnabled=true -Dperf-test.exporter=local
  • If you launch your automated tests as a java application, please make sure that launch parameters are defined as system properties

Exporter

Exporter parameter is used to set an exporting strategy that will be used to send collected performance metrics to its final store. There are three options available.

Local

Specifying the following Maven argument -Dperf-test.exporter=local, collected performance metrics will be stored to a folder from which tests are launched. This folder, by default, is perf-test-results, but this folder can be changed using the following Maven argument perf-test.results.directory.

Remote

  • Using this option, namely -Dperf-test.exporter=remote, collected performance metrics will be sent to a remote storage so that metrics can be analyzed after several test launches to observer performance trends later on.

  • Continuous Perf Test is delivered with both the remote storage and UI application for demonstration purpose.

  • The UI application serves as a dashboard where performance trends can be seen based on collected performance metrics by Continuous Perf Test agent.

Note: All the data (performance metrics) saved in the remote storage is cleaned once per week.

Opted

If you would like to use your own exporter for collecting performance metrics, it is required to specify the following Maven argument -Dperf-test.exporter=opted. Besides, you are expected to implement the following interface in your project com.github.continuousperftest.service.MetricExporterService and register the implemented exported using ServiceLoader.

Code example of how to implement your own exporter
import com.github.continuousperftest.entity.domain.Perfomance;
import com.github.continuousperftest.service.MetricExporterService;
import java.util.List;

public class YourOwnExporterServiceImpl implements MetricExporterService {

  @Override
  public void export(List<Perfomance> metrics) {

    // save a list of Performance object

  }

}
Using ServiceLoader to register the implemented exporter

You can use service loaded mechanism for adding your exporter to the Continuous Perf Test agent. JDK offers a very elegant mechanism to specify implementations of interfaces on the class path via the ServiceLoader class. With ServiceLoader, all you need to do to register implemented exporter is the implementation of your exporter in your project and a configuration file. When you run tests, the Continuous Perf Test agent will automatically find your implementation of your exporter.

To register the implemented exported, the following steps are to be done:

  • Create the folder META-INF/services in the src/main/resources folder;
  • Create a file that is called com.github.continuousperftest.service.MetricExporterService inside the META-INF/services folder;
  • Write full name of the implemented exporter in the first line, for instance: packge.where.your.exporter.is.placed.YourOwnExporterServiceImpl.

UI application

  • The application is hosted using the following host

  • To use the dashboard that the Continuous Perf Test agent is delivered with, it is required to run tests using TestNG groups since charts are built by selecting data for charts based on TestNG groups and a number of threads that tests were launched in.

Contributing

Please read CONTRIBUTING.md for details of the process for submitting pull requests to us.

License

This project is licensed under the GPL-3.0 License - see the LICENSE.md file for details

com.github.continuousperftest

Continuous Perf Test

public repositories of Continuous Perf Test: services, integrations, clients, etc.

Versions

Version
1.0.0