Monitoring servers while executing tests (using VisualVM)
When executing test scripts, it is important to monitor the server resources where the tested application is being hosted. Resources such as CPU, memory, thread count and thread pool, I/O resources, and so on are integral to the performance of an application. Monitoring these resources helps give crucial insights into where the bottlenecks lie in the tested application or hosted environment.
How to do it…
In this recipe, we will show you how to monitor application resources using VisualVM, a tool that comes bundled with standard JDK installation files. Perform the following steps:
Install Maven, Git, and JDK 7 as described in the Appendix.
Note
The examples have been tested with JDK 7 only. At the time of writing this, they haven't been updated to work with JDK 8.
Create a directory to keep the sample code. We will refer to this as
CODE_SAMPLES
.Open a terminal or DOS prompt and change the
CODE_SAMPLES
directory.Clone the application using...