The Metrics plugin for Jenkins adds capability for a Jenkins job to generate load on your site, presenting benchmarking figures as well as Metrics data. The goal is to have a lightweight load test as part of you countinous integration setup. The target installation is assumed to have Metrics data collection enabled.
You'll get two reports from the Metrics plugin. The first one will give the avarage time to load a page as well as the avarage requests per second your installation delivers. This is presented in a graph over time so you can see how your implementation affects the page load.
The second report will give you rendering time per output template from the Metrics data generated from the initial load. This will give you a more fine grained presentation on how the different elements evolve over time.
The latest binary build of the plugin (metrics.hpi) is available in the nexus repository on http://maven.polopoly.com/nexus. Contact Polopoly Support if you don't have access to this repository.
This is the link to the latest release: http://goo.gl/oCCCBR (or the complete link is: http://maven.polopoly.com/nexus/service/local/artifact/maven/redirect?r=professional-services&g=com.polopoly.ps.jenkins&a=metrics&v=LATEST)
You can also build the project for your self:
git clone https://github.com/polopolyps/Metrics-Plugin.git
cd Metrics-Plugin
mvn install
Now you should have the plugin available for you at target/metrics.hpi.
To install it in Jenkins you'd upload the metrics.hpi to your Jenkins installation under. In the Jenkins GUI you'd go to Manage Jenkins -> Manage Plugins -> Advanced and there you have a section called Upload Plugin.
Metrics can now be added to your new job in following way (example when creating a new job on an environment running Polopoly webapps on port 8080):
- Create a new job in Jenkins
- Choose "Build a free-style software project"
- Under "Build" add build step "Load generator". The load is generated using Apache Bench. A number of URLs can be added to generate load. Settings per url:
- URL: The url to do metrics on.
- Description ("Start page", "Search page", "Article Page" ...)
- Number of concurrent threads: Number of concurrent threads doing requests.
- Number of requests per thread: Number of requests generated by each thread.
- Clear Metrics data before generating load?: Check/uncheck. If unchecked it is possible to see how load varies between builds.
- Global Settings:
- Metrics servlet host: http://<host/localhost>:8080/polopolydevelopment/Metrics
- Polopoly Webservice URL: http://<host/localhost>:8080/polopoly/ws
- Polopoly Webservice credentials: sysadmin:...
- Save
In order to get metrics data you need to activate it from the Polopoly GUI. Go to Root Department > SiteEngine > Configuration and check COLLECT RENDER METRICS. You need to restart the webapp server in order to push out the setting.
In Jenkins there exists a "Page load test report" in the left navigation which holds a accumulated graphs for page loads for defined URLs that has been run by the load builder.
In Jenkins there exists a "Metrics report" in the left navigation which holds a accumulated graphs for metrics that has been run by jobs using the Matrics Plugin in the build.
If you want to improve and/or expand the plugin, simply fork the repository, do your magic, push your changes of send us a pull request. To run and debug it locally you'd use the following commands:
mvn hpi:run -Djetty.port=8090
or
mvnDebug hpi:run -Djetty.port=8090
The jetty.port paramater is optional but often wanted.