Friday, April 15, 2011

JMeter -- Process Setup 03 -- Adding Ant taks and First Test run

This is part three of our setup.  Part two can be found here: http://dudewheysmehblog.blogspot.com/2011/03/jmeter-process-setup-02.html

We now have Ant working with JMeter.  Next we need to extend Ant with two external tasks:
  1. Download Ant-Contrib from here.  At the top it usually asks if you are looking for the latest version -- you can click that and download it.
  2. Download the Antelope Tasks from here (if it is no longer a working link, do a Google search for "antelope_tasks.jar").
  3. Extract Ant-Contrib to the C:\ drive (or any other preferred location -- sometimes I like putting it in the ANT_HOME directory).
  4. Copy the antelopetasks-3.2.10.jar into the ant \lib folder (C:\apache-ant-1.8.2\lib).
  5. Copy the ant-contrib-1.0b3.jar into the ant \lib folder (C:\apache-ant-1.8.2\lib).

Ant is now extended!

Let's try the example buildfile which comes with JMeter to see how this works.

  1. Open a command prompt.
  2. Navigate to your JMeter \extras folder:
    cd C:\jakarta-jmeter-2.4\extras
  3. Enter
    ant
The buildfile should run, JMeter should start, and the XSLT should be processed.  The build is SUCCESSFUL.

You should now see three new files in your extras folder: Test.html, Test.jmx, and Test.jtl.
Double-click on the Test.html file to see the results of the test run.

Congrats!  You now have programmatically run a JMeter test using Ant from the command line!


Next steps:

  • Create a directory structure for organizing JMeter test scripts, results, and reports.
  • Edit jmeter.properties and create extra.properties file.
  • Create custom build.xml file.
    • Extended with AntContrib and AntelopeTasks.
  • Edit XSL files to show more information / calculations.
    • Split the times and latency (Time to First Byte and Time to Last Byte).
    • Add Min, Max, Average, Standard Deviation, and 90% calculations.
    • Add run times and custom title.
    • Edit the default Java memory heap size to prevent out of memory errors.
    • Duplicate the file and strip out the details for quick loading the browser and phones.
    • Edit the build file to transform the results twice, detailed and non-detailed.
    • Edit the build file to be able to perform transformations at will.
    • Add a different XSLT processor to handle the transformations if needed.
  • Create Performance Monitor Data Collector Set.
    • Counters that can be used and links to resources.
  • Creating batch file to run the ant commands.
  • Edit build.xml file to handle auto start/stop of Perfmon.
  • Edit build.xml file to auto send mails upon Success or Failure.

2 comments:

  1. Where's the next part of this tutorial!?

    ReplyDelete
  2. Idotta,
    I haven't had time to put the rest together. Please shoot me an email and I'll try to help you with whatever you're working on!
    dudewheysmehemail@gmail.com

    ReplyDelete

Related Posts Plugin for WordPress, Blogger...