Showing posts with label demo application. Show all posts
Showing posts with label demo application. Show all posts

Tuesday, 29 October 2019

Setup an application to work with Apache Benchmark


Clone the repository ‘https://github.com/harikrishna553/load-test’.
$git clone https://github.com/harikrishna553/load-test
Cloning into 'load-test'...
remote: Enumerating objects: 28, done.
remote: Counting objects: 100% (28/28), done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 28 (delta 2), reused 26 (delta 0), pack-reused 0
Unpacking objects: 100% (28/28), done.


Project structure looks like below.
$tree
.
└── load-test
    ├── pom.xml
    └── src
        └── main
            └── java
                └── com
                    └── sample
                        └── app
                            ├── App.java
                            ├── controller
                            │   └── EmployeeController.java
                            ├── model
                            │   └── Employee.java
                            └── util
                                └── EmployeeUtil.java

10 directories, 5 files

Navigate to the directory, where pom.xml is located and execute the command ‘mvn package’ to generate .jar file.
$find . -name *jar
./target/load-test-1.jar

Run below command to run load-test application.
java -jar {jar_file_path} --server.port={port_number}

Below command starts the application at port 9191.
java -jar ./target/load-test-1.jar --server.port=9191


Open the url ‘http://localhost:9191/api/v1/employees’ in browser, you can see below kind of screen.

That’s it you are done with application setup.

Previous                                                    Next                                                    Home