Sign inSign up

jmb12686/loadtest-microservice

By jmb12686

Updated over 8 years ago

RESTful Microservice for generating CPU load. Utilizes the Wildfly Swarm JEE Microprofile container

Image
0

10K+

jmb12686/loadtest-microservice repository overview

Description

This application exposes a simple REST endpoint to execute a CPU intensive test. This docker image can be used for generating arbitrary CPU load. Load is generated by multiplying a BigInteger N iterations. The application load generator is a simple microservice, exposed via a RESTful API. The microservice utilizes Wildfly Swarm and the JEE Microprofile.

Run Docker image:

By default, the Docker image will set the Wildfly Swarm port to 9999, and to run the image, execute the following command:

  • docker run -p 8080:9999 loadtest-microservice

Customizing server and docker port mappings

You can change the Wildfly Swarm (server) port at runtime with:

  • docker run -p 8080:12345 -e SERVER_PORT=12345 loadtest-microservice

Invoke the API:

  • API URL -> http://localhost:PORT/loadtest-api/iterations/NUM_OF_ITERATIONS
  • Substitute PORT with mapped originating host port used in the docker run command. In the run command above, this would be 8080.
  • Substitute NUM_OF_INTERATIONS with an numeric value
  • Use cURL to issue GET requests to the endpoint, or simply use a browser to hit the URL.

Source Code:

You can find the Java application source code including the Dockerfile used to build this image on Github @ https://github.com/jmb12686/microservice-loadtest

Tag summary

Content type

Image

Digest

Size

143.8 MB

Last updated

over 8 years ago

docker pull jmb12686/loadtest-microservice