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.
- Host: GitHub
- URL: https://github.com/jmb12686/microservice-loadtest
- Owner: jmb12686
- Created: 2017-12-03T00:33:10.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-04-29T20:14:33.000Z (over 4 years ago)
- Last Synced: 2025-02-13T08:29:16.972Z (8 months ago)
- Language: Java
- Size: 7.81 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
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`