Quick Search
Browse
Pages
Blog
Labels
Attachments
Mail
Advanced
What’s New
Space Directory
Feed Builder
Keyboard Shortcuts
Confluence Gadgets
Log In
Sign Up
Dashboard
Sonar
Copy Page
You are not logged in. Any changes you make will be marked as
anonymous
. You may want to
Log In
if you already have an account. You can also
Sign Up
for a new account.
This page is being edited by
.
Paragraph
Paragraph
Heading 1
Heading 2
Heading 3
Heading 4
Heading 5
Heading 6
Preformatted
Quote
Bold
Italic
Underline
More colours
Strikethrough
Subscript
Superscript
Monospace
Clear Formatting
Bullet list
Numbered list
Outdent
Indent
Align left
Align center
Align right
Link
Table
Insert
Insert Content
Image
Link
Attachment
Symbol
Emoticon
Wiki Markup
Horizontal rule
tinymce.confluence.insert_menu.macro_desc
Info
JIRA Issue
Status
Gallery
Tasklist
Table of Contents
Other Macros
Page Layout
No Layout
Two column (simple)
Two column (simple, left sidebar)
Two column (simple, right sidebar)
Three column (simple)
Two column
Two column (left sidebar)
Two column (right sidebar)
Three column
Three column (left and right sidebars)
Undo
Redo
Find/Replace
Keyboard Shortcuts Help
<table class="wysiwyg-macro" data-macro-name="unmigrated-inline-wiki-markup" data-macro-parameters="atlassian-macro-output-type=BLOCK" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e3VubWlncmF0ZWQtaW5saW5lLXdpa2ktbWFya3VwOmF0bGFzc2lhbi1tYWNyby1vdXRwdXQtdHlwZT1CTE9DS30&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre>{iframe:src=http://update.sonarsource.org/plugins/jmeter.html|width=700|height=250|frameborder=0} Your browser does not support iframes. {iframe}</pre></td></tr></table> <h2>Compatibility with Sonar</h2> <table class="confluenceTable"><tbody> <tr> <th class="confluenceTh"><p> Plugin </p></th> <td class="confluenceTd"><p> 0.1 </p></td> <td class="confluenceTd"><p> 0.2 </p></td> </tr> <tr> <th class="confluenceTh"><p> Sonar </p></th> <td class="confluenceTd"><p> 2.4+ </p></td> <td class="confluenceTd"><p> 2.4+ </p></td> </tr> </tbody></table> <h2>Quick guide</h2> <ul class="alternate"> <li>Install plugin in SONAR (copy to extensions/plugins/) and restart SONAR server.</li> </ul> <table class="wysiwyg-macro" data-macro-name="info" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm99&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"> <p><strong>New feature in plugin version 0.2</strong><br /> There is now a jmeter-report-server embedded inside the sonar plugin, and there is a new configuration option (Local jtl file) where you can set a jtl file path, local to the sonar server. If this option is set, no remote jmeter report server if used, and jmeter test results are taken from the local file.</p></td></tr></table> <p>If you want to use JMeter Report Server then:</p> <ul class="alternate"> <li>Download <a href="http://repository.codehaus.org/org/codehaus/sonar-plugins/jmeter/jmeter-report-server/0.2/jmeter-report-server-0.2-jar-with-dependencies.jar">jmeter-report-server-0.2-jar-with-dependencies.jar</a></li> <li>Run server where your JMeter instance is running: <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> > java -Dtestconfig.name.jtlpath=/path/to/file.jtl -jar jmeter-report-server.jar </pre></td></tr></table></li> <li>Go to your system settings in SONAR and set host and port for your JMeter Report Server.</li> <li>Go to your project settings and set the "configuration key" (this must be the same you set in your property name).</li> <li>Run mvn sonar:sonar</li> <li>Add JMeter widget to your dashboard and your JMeter metrics will be shown <img class="emoticon emoticon-smile" data-emoticon-name="smile" border="0" src="/s/en_GB/3278/15/_/images/icons/emoticons/smile.png" alt="(smile)" title="(smile)" /></li> </ul> <table class="wysiwyg-macro" data-macro-name="info" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2luZm99&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="RICH_TEXT"><tr><td class="wysiwyg-macro-body"> <p>JTL files must be provided as a result of JMeter tests.<br /> JMeter Report Server is just to make JTL files available remotely.</p></td></tr></table> <h2>Description / Features</h2> <p>This plugin collects performance tests results from <a href="http://jakarta.apache.org/jmeter/">Apache JMeter</a>. <a href="http://jakarta.apache.org/jmeter/">Apache JMeter</a> may be used to test performance both on static and dynamic resources (files, Servlets, Perl scripts, Java Objects, Data Bases and Queries, FTP Servers and more). It can be used to simulate a heavy load on a server, network or object to test its strength or to analyze overall performance under different load types. You can use it to test your server/script/object behavior under heavy concurrent load.</p> <p>If it is the first time you hear from <a href="http://jakarta.apache.org/jmeter/">Apache JMeter</a> then you should try it before using this plugin.</p> <p>The following metrics are included in Sonar:</p> <ul class="alternate"> <li>Duration (in seconds)</li> <li>Error density (number of errors / number of requests * 100)</li> <li>Average response time for requests</li> <li>Average response time for transactions</li> <li>Successful requests per minute</li> <li>Successful requests per minute and user</li> <li>Response time deviation for requests</li> <li>Response time deviation for transactions</li> <li>Number of requests</li> <li>Number of transactions</li> <li>Successful transactions per minute</li> <li>Successful transactions per minute and user</li> </ul> <p>This is an example of the widget you will see in Sonar:</p> <p><img class="confluence-embedded-image confluence-external-resource confluence-content-image-border image-center" src="http://servicios.excentia.es/confluence/download/attachments/11108389/sonar-jmeter-plugin-widget.png" data-image-src="http://servicios.excentia.es/confluence/download/attachments/11108389/sonar-jmeter-plugin-widget.png"></p> <h2>Usage & Installation</h2> <h3>JMeter</h3> <p>JMeter installation is very easy. JMeter is developed with Java and it is distributed as a compressed file.</p> <p>You can download it from <a href="http://jakarta.apache.org/jmeter">http://jakarta.apache.org/jmeter</a> and then run the provided script (bin/jmeter).</p> <h3>Recording a test in JMeter</h3> <p>You can find a step by step tutorial in JMeter's website: <a href="http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf">http://jakarta.apache.org/jmeter/usermanual/jmeter_proxy_step_by_step.pdf</a></p> <p>It describes how to record a test plan using the JMeter proxy.</p> <p>You can also take a look at this video tutorial to see how to record a test with JMeter:</p> <img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3dpZGdldDp1cmw9aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PTNEQzhqRUxMNFNvfQ&locale=en_GB&version=2" data-macro-name="widget" data-macro-parameters="url=http://www.youtube.com/watch?v\=3DC8jELL4So"> <p>SONAR JMeter plugin uses the results datafile generated by JMeter (file with extension .JTL) so remember to configure your test plan to store the results in a single JTL file.</p> <p>In this video we show you how to set this JTL file:</p> <img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3dpZGdldDp1cmw9aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PXJqNi14MXYzZ3RvfQ&locale=en_GB&version=2" data-macro-name="widget" data-macro-parameters="url=http://www.youtube.com/watch?v\=rj6-x1v3gto"> <h3>JMeter Report Server</h3> <p>JMeter Report Server is a server that generates performance reports from JMeter results. SONAR JMeter Plugin uses this server to get the performance metrics from the projects.</p> <p>It must be installed on the same machine with JMeter tool. The server will read the JTL files to get provide all the data to SONAR.</p> <p>JTL files must be provided as a result of JMeter tests. JMeter Report Server is just to make JTL files available remotely.</p> <h4>JMeter Report Server Configuration</h4> <p>JMeter Report Server needs to know where the JTL files are located. You can set your test configuration when running the server through command line system properties:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> java -Dtestconfig.name1.jtlpath=/path/to/file1 -jar jmeter-report-server.jar </pre></td></tr></table> <p>where name is the test configuration that you will use in SONAR JMeter Plugin project settings.</p> <p>Or you can also set this location by creating a property file "jmeter-report-server.properties" with all your test configurations:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> testconfig.name1.jtlpath=/path/to/file1 testconfig.name2.jtlpath=/path/to/file2 ... testconfig.nameM.jtlpath=/path/to/fileN </pre></td></tr></table> <p>This is useful is you have multiple projects in your JMeter environment and you want to manage all your tests with a single JMeter Report Server.</p> <p>Port and maxConnections are now configurable properties and they can be set as system properties (using -D in the start command) or as normal properties in the jmeter-report-server.properties file as shown below.</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> # Using default port port=4444 # Unlimited connections maxConnections=0 </pre></td></tr></table> <p>Here you have a test configuration example:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> testconfig.iceweb.jtlpath=/home/carlos/jmeter_work/iceweb.jtl </pre></td></tr></table> <p>This configuration will set JTL file "/home/carlos/jmeter_work/iceweb.jtl" to the project "iceweb". </p> <p>"iceweb" will be the name for your test configuration. SONAR plugin settings will use that name.</p> <h4>JMeter Report Server Installation</h4> <p>Server is package in a single jar with all dependencies, so just download JMeter Report Server and put it wherever you want <img class="emoticon emoticon-smile" data-emoticon-name="smile" border="0" src="/s/en_GB/3278/15/_/images/icons/emoticons/smile.png" alt="(smile)" title="(smile)" /></p> <h4>Running JMeter Report Server</h4> <p>You can start the server with this command:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> java -Dtestconfig.name1.jtlpath=/path/to/file1 -jar jmeter-report-server.jar </pre></td></tr></table> <p>NOTE: replace "jmeter-report-server.jar" with the name of the file downloaded and testconfig property with your project name and the path to the JTL file.</p> <h3>SONAR JMeter Plugin</h3> <h4>Installation</h4> <ol> <li>Copy the jar into /extensions/plugins/ directory</li> <li>Restart Sonar server</li> </ol> <h4>Configuration</h4> <p>This video shows how to configure JMeter plugin in SONAR:</p> <img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e3dpZGdldDp1cmw9aHR0cDovL3d3dy55b3V0dWJlLmNvbS93YXRjaD92PWFPSzdwT0xKeHgwfQ&locale=en_GB&version=2" data-macro-name="widget" data-macro-parameters="url=http://www.youtube.com/watch?v\=aOK7pOLJxx0"> <ul class="alternate"> <li>Project must exist in SONAR before using JMeter plugin</li> <li>JMeter Report Server must be up and running if using remote configuration, and it must have a test configuration with the same name you set in SONAR JMeter plugin settings.</li> <li>JTL file must exist in the host that is running JMeter Report Server.</li> </ul> <p>Since 0.2 version, there is a jmeter-report-server embedded inside the sonar plugin, and there is a new configuration option (Local jtl file) where you can set a jtl file path, local to the sonar server. If this option is set, no remote jmeter report server if used, and jmeter test results are taken from the local file.</p> <p>Now it possible to configure units of time in your global or project settings. You can set seconds, minutes or hours.</p> <p>Add JMeter widget to your dashboard and next time you run "mvn sonar:sonar" you will retrieve performance metrics from JMeter and SONAR will show them.</p> <h2>Usage with maven-jmeter-plugin</h2> <p>Since 0.2 release the plugin can be used together with <a href="https://github.com/Ronnie76er/jmeter-maven-plugin/wiki">Maven JMeter Plugin</a> and <a href="http://cargo.codehaus.org/Maven2+plugin">Cargo</a> to perform the tests and collect performance metrics in just one maven goal:</p> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> mvn cargo:start org.apache.jmeter:maven-jmeter-plugin:jmeter sonar:sonar </pre></td></tr></table> <p>You have to configure your project to be able to do that:</p> <ul class="alternate"> <li>Include your jmeter.properties and all your JMeter tests in "src/test/jmeter"</li> <li>Configure your new maven plugins in your project and set "jmeter-reports" as the your report directory.</li> </ul> <table class="wysiwyg-macro" data-macro-name="code" style="background-image: url(/plugins/servlet/confluence/placeholder/macro-heading?definition=e2NvZGV9&locale=en_GB&version=2); background-repeat: no-repeat;" data-macro-body-type="PLAIN_TEXT"><tr><td class="wysiwyg-macro-body"><pre> <!-- Plugin to launch your JMeter tests in Maven --> <plugin> <groupId>org.apache.jmeter</groupId> <artifactId>maven-jmeter-plugin</artifactId> <version>1.0-GA</version> <configuration> <reportDir>${project.build.directory}/jmeter-reports</reportDir> </configuration> </plugin> <!-- Plugin to start a container and be able to run your webapp and perform your JMeter tests This example uses Tomcat 7 as the container. --> <plugin> <groupId>org.codehaus.cargo</groupId> <artifactId>cargo-maven2-plugin</artifactId> <version>1.1.0</version> <configuration> <container> <containerId>tomcat7x</containerId> <zipUrlInstaller> <url>http://archive.apache.org/dist/tomcat/tomcat-7/v7.0.12/bin/apache-cat-7.0.12.zip</url> </zipUrlInstaller> </container> </configuration> </plugin> </pre></td></tr></table> <p>To get sonar-jmeter-plugin working in maven side, there must not be any configuration values set in Sonar (all of them must be blank).</p> <h2>Known limitations</h2> <ul class="alternate"> <li>You can only use one JTL file per project.</li> </ul> <h2>Changelog</h2> <img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2ppcmFpc3N1ZXM6YW5vbnltb3VzPXRydWV8dGl0bGU9UmVsZWFzZSAwLjJ8aGVpZ2h0PTE5MHx3aWR0aD05MDB8Y29sdW1ucz10eXBlO2tleTtzdW1tYXJ5O3ByaW9yaXR5O3N0YXR1cztyZXNvbHV0aW9ufHVybD1odHRwOi8vamlyYS5jb2RlaGF1cy5vcmcvc3IvamlyYS5pc3N1ZXZpZXdzOnNlYXJjaHJlcXVlc3QteG1sL3RlbXAvU2VhcmNoUmVxdWVzdC54bWw_anFsUXVlcnk9cHJvamVjdCslM0QrU09OQVJQTFVHSU5TK0FORCtmaXhWZXJzaW9uKyUzRCslMjJKTUVURVItMC4yJTIyJnRlbXBNYXg9MTAwMH0&locale=en_GB&version=2" data-macro-name="jiraissues" data-macro-parameters="anonymous=true|columns=type;key;summary;priority;status;resolution|height=190|title=Release 0.2|url=http://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery\=project+%3D+SONARPLUGINS+AND+fixVersion+%3D+%22JMETER-0.2%22&tempMax\=1000|width=900"> <p><br class="atl-forced-newline" /></p> <img class="editor-inline-macro" src="/plugins/servlet/confluence/placeholder/macro?definition=e2ppcmFpc3N1ZXM6YW5vbnltb3VzPXRydWV8dGl0bGU9UmVsZWFzZSAwLjF8aGVpZ2h0PTE5MHx3aWR0aD05MDB8Y29sdW1ucz10eXBlO2tleTtzdW1tYXJ5O3ByaW9yaXR5O3N0YXR1cztyZXNvbHV0aW9ufHVybD1odHRwOi8vamlyYS5jb2RlaGF1cy5vcmcvc3IvamlyYS5pc3N1ZXZpZXdzOnNlYXJjaHJlcXVlc3QteG1sL3RlbXAvU2VhcmNoUmVxdWVzdC54bWw_anFsUXVlcnk9cHJvamVjdCslM0QrU09OQVJQTFVHSU5TK0FORCtmaXhWZXJzaW9uKyUzRCslMjJKTUVURVItMC4xJTIyJnRlbXBNYXg9MTAwMH0&locale=en_GB&version=2" data-macro-name="jiraissues" data-macro-parameters="anonymous=true|columns=type;key;summary;priority;status;resolution|height=190|title=Release 0.1|url=http://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery\=project+%3D+SONARPLUGINS+AND+fixVersion+%3D+%22JMETER-0.1%22&tempMax\=1000|width=900"> <p><br class="atl-forced-newline" /></p>
Please type the word appearing in the picture.
Attachments
Labels
Location
Watch this page
< Edit
Preview >
Loading…
Save
Cancel
Next hint
search
attachments
weblink
advanced