In this recipe, you will learn how to enable the statistics of the datasource to check whether we are getting the most out of it, or if we need to tune something with the datasource, or at worst, scale with the database.
To get an idea of what is going on with our datasource, let's generate some traffic towards the database. In this case, we will use the application named datasource-traffic-generator
. To obtain the artifact to deploy, please refer to the Software prerequisites recipe in Chapter 1, Welcome to WildFly!. Furthermore, in the source code of the application, you can find an Apache JMeter (also JMeter) project, available at the following path: datasource-traffic-generator/src/main/resources/HTTP Request Defaults.jmx
.
Briefly, Apache JMeter is a testing tool used to make a stress test; as a matter of fact, we will stress the datasource-traffic-generator
application, which inserts some data into the DB.