An open API service indexing awesome lists of open source software.

https://github.com/jmb12686/microservice-loadtest

A Load Test microservice implemented using the Java EE Microprofile and Wildfly Swarm.
https://github.com/jmb12686/microservice-loadtest

Last synced: 6 months ago
JSON representation

A Load Test microservice implemented using the Java EE Microprofile and Wildfly Swarm.

Awesome Lists containing this project

README

          

# LoadTest Microservice
This is a microservice, utilizing Wildfly Swarm and the Java Microprofile.

#### Description
This application exposes a simple REST endpoint to execute a CPU intensive test. This can be used for generating arbitrary CPU load.
Load is generated by multiplying a `BigInteger` N iterations.

The API is `http://HOSTNAME:SWARM_PORT/loadtest-api/iterations/NUM_OF_ITERATIONS`

#### Compile, Build, and Run Instructions
##### Compile and Execute
```bash
mvn wildfly-swarm:run
```
##### Create "fat" executable uberjar
```bash
mvn package
```
##### Run executable uberjar
```bash
java -jar loadtest-service-swarm.jar
```

##### Create hollow uberjar
Use this to decouple the wildfly container executable jar from the resulting war file. This can allow layered containerization
```
mvn package -Dswarm.hollow=true
```
Alternatively, configure the wildfly swarm plugin with `true` within the `pom.xml`

##### Run hollow uberjar and war
```bash
java -jar loadtest-service-hollow-swarm.jar loadtest-service.war
```

#### Docker Instructions
##### Create a Docker image
Run `mvn clean package` then from command line, execute `docker build --tag=loadtest-microservice .`
##### Run Docker image
By default, the Docker image will set the Wildfly Swarm port to 9999, and to run the image:
`docker run -p 8080:9999 loadtest-microservice`

You can change the Wildfly Swarm (server) port at runtime with:
`docker run -p 8080:12345 -e SERVER_PORT=12345 loadtest-microservice`