Friday, August 19, 2011

JMeter -- Process Setup 04 -- Create/Populate Folders

This is part four of our Setup process.  Part three can be found here:

When we left of from last time, we still had the following to do:
  • Create a directory structure for organizing JMeter test scripts, results, and reports.
  • Edit and create 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.
Let's start with the directory structure.

Creating Folders and Populating with necessary files
    We'll be doing all of this inside the JMeter bin folder.
    1. Open up a Windows Explorer window (Windows Key + E).
    2. C:\jakarta-jmeter-2.4\bin.
    3. Create the following folders: reports, results, scripts, and var.
    4. Open the results folder and create 2 folders: log, and reportXSLs.
    5. Open the reports folder and create a folder: images.
    This is what your folder structure should look like.

    I've created a shared collection in Google Docs containing all the necessary files to populate these folders.
    Navigate to that link.
    1. Place all of the files in the main JMeter collection directly into the JMeter bin folder (\bin). *NOTE* Currently some of these files are not yet ready -- please check back, comment, or email me if you have any questions or doubts.
    2. Place all of the files in the images collection into the images folder we just created (\bin\report\images).
    3. Place all of the files in the reportXSLs collection into the reportXSLs folder we just created (\bin\results\reportXSLs).
    4. Place all of the files in the var collection into the var folder we just created (\bin\var).
    What are these folders for?
    I'm glad you asked!  
    • scripts
      • When we run JMeter normally using the GUI, we will create test scripts and save them in our scripts folder.
      • If we have many simultaneous projects, we can sort them by creating sub-folders under scripts.
        • Example: We have a "Google" project and a "Yahoo!" project.  We will create tests and save them in the scripts folder under their own respective folders: Google => \bin\scripts\Google & Yahoo! => \bin\scripts\Yahoo
      • If we have any CSV data sets, they too will be stored inside the scripts/project_Subfolder.  We will cover this naming convention in a future post, as we'll have to have a way for any remote JMeter clients to pull the correct CSV information when running.
    • results
      • When JMeter runs in non-GUI mode, JMeter specific XML files are generated which contain all of the run data.  These files have the extension .jtl.
      • We will have these .jtl files stored inside the results folder within separate subfolders for each project.
      • Each of the .jtl files will be created during the run and will be named with the timestamp of the run, so even if anything gets corrupted during the run or if the transformation fails at the end of the run, we will still have the data separate and can transform whatever is there into a report.
      • The log folder contains the log.txt file which will contain the ANT output text.  The log.txt file will be attached to the success / failure emails.
      • The reportXSLs folder has the 2 XSL transformation files responsible for turning the .jtl into a web friendly .html report.  One of the files will output a very small/lightweight report with no details of each iteration.  The other file will output a huge report with every single data point the .jtl had to offer.  The small one is perfect for managers to view from their mobile phones, which gives us cool points for implementing it that way!
    • reports
      • The reports folder contains all of the .html report files, stored within their respective projects specific sub-folders.  Each report will be named accordingly with the project name and the timestamp when the test was run.
      • The reports folder also contains the image folder where any images needed for emails and reports will be stored.
      • The Reports folder will be shared and made available across the network, so people can access it remotely.  It will also be made public via IIS (or some other internet service) so that the files can be linked to a nice URL (inside your VPN) such as http://jmeter
    • var
      • The var folder contains all of the .txt files which will hold variables for ANT.  It is a workaround which I'll go into more detail in a later post.
    In the next post we will edit the file and we will create the file.

    Part five can be found here:

    No comments:

    Post a Comment

    Related Posts Plugin for WordPress, Blogger...