26.23. LoadTest

26.23.1. Overview

The LoadTest Sensor is an Ant task that sends the results of performance testing using the HackyLoadTest system to the Hackystat server. The LoadTest sensor represents this metric data using the Perf sensor data type, documented in Section 25.13, “Perf”

HackyLoadTest is a custom performance analysis system developed to support load testing of Hackystat. It is used to help detect performance bottlenecks in Hackystat and to uncover various concurrency related issues such as concurrent modification problems. HackyLoadTest supports both sending of various kinds of raw sensor data at various sizes and transmission rates to the server, as well as the invocation of various Hackystat analysis with different arguments at different intervals of time. It can also simulate an arbitrary number of different users. The result of a successful HackyLoadTest performance test is typically expressed as the average response time for a request. For example, if the performance test consisted of sending 60 requests for the Project File Time analysis per minute for two minutes from three different users, the result would be the average response time calculated from those 360 requests. HackyLoadTest includes a timeout function so that the user can specify a maximum time to wait for a response, and will report the number of requests for which it did not receive a response during a test.

The HackyLoadTest sensor is an Ant task that reads in the XML file produced by the HackyLoadTest task and sends the results to Hackystat. The data includes whether or not the performance test was successful (i.e. were there any dropped requests), the average time for the requests specified in the test, and the parameters to the test which indicate what analysis was invoked at what frequency and so forth.

26.23.2. Installation

26.23.2.1. Prerequisites

The HackyLoadTest sensor requires Java 1.5.0 or later, Ant 1.6.5 or later, and HackyLoadTest 1.0 or later.

26.23.2.2. Download HackyInstaller and set your Hackystat Host and User Key

Follow the instructions in Chapter 2, Client-side configuration: Tool sensor installation to set your Hackystat host and user key.

26.23.2.3. Configure and install the HackyLoadTest sensor

In the HackyInstaller main window, select the HackyLoadTest sensor and press "Configure Selected Sensor". Figure 26.43, “ HackyLoadTest sensor installer configuration window ” shows what the configuration window should look like after the path to Ant is set, the sensor is enabled, and the "Install" button has been pressed to install the sensor.

Figure 26.43.  HackyLoadTest sensor installer configuration window


HackyLoadTest sensor installer configuration window

This sensor supports the following properties and paths:

  • Enable HackyLoadTest Sensor: This property controls whether the sensor is active or not. If not checked, the sensor will not collect or send data even if installed.

  • Ant home directory: This path specifies the top-level directory for Ant. The HackyLoadTest sensor requires the placement of a sensor executable into Ant's lib/ directory.

26.23.2.4. Define an Ant target that runs the HackyLoadTest tool and the HackyLoadTest sensor

Define a target in your build.xml file to invoke HackyLoadTest and write out its results in XML format. The target should then invoke the HackyLoadTest sensor to send the results to Hackystat. Example 26.56, “An example HackyLoadTest target” illustrates one possible definition of such a target.

Example 26.56. An example HackyLoadTest target

<target name="hackyloadtest">
  <property name="loadtest.dir" value="${basedir}/loadtest"/> 
  <property name="loadtest.config.dir" value="${loadtest.dir}/config"/>    
  <property name="loadtest.report.xml.dir" value="${loadtest.dir}/report/xml"/>   
  <property name="loadtest.report.html.dir" value="${loadtest.dir}/report/html"/>    
  <delete dir="${loadtest.report.xml.dir}" />
  <delete dir="${loadtest.report.html.dir}" />
    
  <!-- Run the load tests for Hackystat -->
  <taskdef name="hackyLoadTest" classname="org.hackystat.perf.HackyPerfAntTask"/> 
  <mkdir dir="${loadtest.report.xml.dir}" />
  <hackyLoadTest todir="${loadtest.report.xml.dir}" verbose="false"> 1
    <fileset dir="${loadtest.config.dir}">
      <include name="*.xml" />
    </fileset>
  </hackyLoadTest>
  	
  <!-- Generate the Load Test HTML Report -->
  <taskdef name="hackyLoadTestReport" classname="org.hackystat.perf.HackyPerfAntReportTask"/> 
  <hackyLoadTestReport todir="${install.build.dir}/reports/hackyPerf/hackystat"> 2
    <fileset dir="${loadtest.report.xml.dir}">
      <include name="*.xml" />
    </fileset>
  </hackyLoadTestReport>  
  	
  <!-- Send the results of this Load Test to Hackystat -->
  <taskdef name="hackyLoadTestSensor" classname="org.hackystat.sensor.loadtest.PerfSensorAntTask"/>  
  <hackyLoadTestSensor projectID="${ProjectID}" > 3
    <fileset dir="${loadtest.report.xml.dir}"> 4
      <include name="*.xml" />
    </fileset>
  </hackyLoadTestSensor>
</target> 

Please note the following regarding Example 26.56, “An example HackyLoadTest target”:

1

Before running the HackyLoadTest sensor, we need to first invoke HackyLoadTest to generate performance analysis data.

2

Running the hackyLoadTestReport target is not required, but is helpful for obtaining the HackyLoadTest results in easily readable HTML format.

3

The hackyLoadTest sensor needs the user to specify the hackystat project that this data should be associated with.

4

The fileset target enables you to tell the sensor where to look for the XML files generated by HackyLoadTest

26.23.3. Installation verification

26.23.3.1. Verify ant output

To verify your HackyLoadTest sensor installation, invoke the target and check to see that data is sent to the server. Example 26.57, “Example HackyLoadTest output” shows the shell output from an example run.

[Note]Note

The HackyLoadTest sensor does not yet support a verbose mode. This is scheduled for implementation in a future release of Hackystat.

Example 26.57. Example HackyLoadTest output

C:\cvs\hackyLoadTest\try-it-yourself>ant demo
Buildfile: build.xml

prepare:

loadtest:
[hackyPerfLoadTest] Rhino classes (js.jar) not found - Javascript disabled
[hackyPerfLoadTest] [SEND:1101926547895] LoadTest(ModerateLoadTest) - Analysis(HitHome) - User(lighttest1)
[hackyPerfLoadTest] [RCVD:1101926547910] LoadTest(ModerateLoadTest) - Analysis(HitHome) - User(lighttest1)
[hackyPerfLoadTest] [SEND:1101926548238] LoadTest(ModerateLoadTest) - Analysis(HitHome) - User(lighttest2)
[hackyPerfLoadTest] [RCVD:1101926548254] LoadTest(ModerateLoadTest) - Analysis(HitHome) - User(lighttest2)
[hackyPerfLoadTest] [SEND:1101926551629] LoadTest(LightLoadTest-1) - SensorData(LightActivityData) - User(mytest)
[hackyPerfLoadTest] [SEND:1101926551988] LoadTest(LightLoadTest-1) - Analysis(HitHome) - User(lighttest2)
[hackyPerfLoadTest] [RCVD:1101926551988] LoadTest(LightLoadTest-1) - Analysis(HitHome) - User(lighttest2)
[hackyPerfLoadTest] [RCVD:1101926552207] LoadTest(LightLoadTest-1) - SensorData(LightActivityData) - User(mytest)
[hackyPerfLoadTest] [SEND:1101926552629] LoadTest(LightLoadTest-1) - Analysis(HitHome) - User(lighttest1)
[hackyPerfLoadTest] [RCVD:1101926552645] LoadTest(LightLoadTest-1) - Analysis(HitHome) - User(lighttest1)
[hackyPerfLoadTest] [SEND:1101926553629] LoadTest(LightLoadTest-1) - SensorData(LightActivityData) - User(mytest)
[hackyPerfLoadTest] [RCVD:1101926554317] LoadTest(LightLoadTest-1) - SensorData(LightActivityData) - User(mytest)
[hackyPerfLoadTest] [SEND:1101926555629] LoadTest(LightLoadTest-1) - SensorData(LightActivityData) - User(mytest)
[hackyPerfLoadTest] [RCVD:1101926556270] LoadTest(LightLoadTest-1) - SensorData(LightActivityData) - User(mytest)
[hackyPerfLoadTest] [SEND:1101926558051] LoadTest(LightLoadTest-2) - Analysis(HitHome) - User(lighttest2)
[hackyPerfLoadTest] [RCVD:1101926558067] LoadTest(LightLoadTest-2) - Analysis(HitHome) - User(lighttest2)
[hackyPerfLoadTest] [SEND:1101926558270] LoadTest(LightLoadTest-2) - Analysis(HitHome) - User(lighttest1)
[hackyPerfLoadTest] [RCVD:1101926558270] LoadTest(LightLoadTest-2) - Analysis(HitHome) - User(lighttest1)

report:
[hackyPerfReport] HackyPerf Reporting...

sensor:
[loadtestSensor] HackyLoadTest sending sensor data...
[loadtestSensor] HackyLoadTest processing file C:\cvs\hackyLoadTest\try-it-yourself\report\xml\HackyPerfReport-Real-A.xml
[loadtestSensor] HackyLoadTest processing file C:\cvs\hackyLoadTest\try-it-yourself\report\xml\HackyPerfReport-Real-B.xml

demo:

BUILD SUCCESSFUL
Total time: 16 seconds

26.23.3.2. List Sensor Data

Once you verify that HackyLoadTest data is being sent from the client, login to your account on your Hackystat server, and use the "List Sensor Data" command on the Extras page to verify that Perf data for today's date was received by the server from the HackyLoadTest tool, as illustrated in Figure 26.44, “ List Sensor Data with HackyLoadTest data ”.

Figure 26.44.  List Sensor Data with HackyLoadTest data


List Sensor Data with HackyLoadTest data

26.23.4. Installation troubleshooting

26.23.4.1. Troubleshooting general client-server problems

The first step in troubleshooting your sensor installation is to verify that your Hackystat host and key settings are valid and that you can contact the Hackystat server, as described in Section 2.4, “HackyInstaller GUI: Setting and verifying the Hackystat host and user key”

26.23.4.2. Checking client-side logging

The HackyLoadTest sensor writes out a file called HackyLoadTest.0.log to the .hackystat/logs directory that can be useful in debugging your installation. Under normal conditions, this file should look similar to Example 26.58, “HackyLoadTest.0.log example for HackyLoadTest sensor”.

Example 26.58. HackyLoadTest.0.log example for HackyLoadTest sensor

Hackystat Version: 6.3.1119 (November 19 2004 15:22:57)
SensorShell started at: 12/01/2004 08:42:40
Type 'help' for a list of commands.
Host: http://hackystat.ics.hawaii.edu/ is available and key is valid.
Defined shell command: Activity
Defined shell command: Coverage
Defined shell command: UnitTest
Defined shell command: BuffTrans
Defined shell command: Perf
Defined shell command: Build
Defined shell command: FileMetric
#> AutoSend [10]
AutoSend OK (set to 10 minutes)
AutoSend enabled every 10 minutes.
>> #> Perf [setTool, Perf]
setTool OK
#> Perf [add, ModerateLoadTest-HitHome, success, , , 15.5, milliseconds, PerformanceTestType=Analysis,StartTime=Wed Dec 01 08:42:27 GMT-10:00 2004,EndTime=Wed Dec 01 08:42:30 GMT-10:00 2004,MaxRequestTimeMillis=16.0,MinRequestTimeMillis=15.0,NumOfCorrectResponses=2,NumOfIncorrectResponses=0,NumOfThreads=2,ProjectId=Testing,HostName=THERESA]
Perf add OK (1 total)
>> #> Perf [add, LightLoadTest-1-HitHome, success, , , 8.0, milliseconds, PerformanceTestType=Analysis,StartTime=Wed Dec 01 08:42:31 GMT-10:00 2004,EndTime=Wed Dec 01 08:42:34 GMT-10:00 2004,MaxRequestTimeMillis=16.0,MinRequestTimeMillis=0.0,NumOfCorrectResponses=2,NumOfIncorrectResponses=0,NumOfThreads=2,ProjectId=Testing,HostName=THERESA]
Perf add OK (2 total)
#> Perf [add, LightLoadTest-1-LightActivityData, success, , , 635.667, milliseconds, PerformanceTestType=ActivitySensorData,StartTime=Wed Dec 01 08:42:31 GMT-10:00 2004,EndTime=Wed Dec 01 08:42:37 GMT-10:00 2004,MaxRequestTimeMillis=688.0,MinRequestTimeMillis=578.0,NumOfCorrectResponses=3,NumOfIncorrectResponses=0,NumOfThreads=1,ProjectId=Testing,HostName=THERESA]
Perf add OK (3 total)
#> Perf [add, LightLoadTest-2-HitHome, success, , , 8.0, milliseconds, PerformanceTestType=Analysis,StartTime=Wed Dec 01 08:42:38 GMT-10:00 2004,EndTime=Wed Dec 01 08:42:40 GMT-10:00 2004,MaxRequestTimeMillis=16.0,MinRequestTimeMillis=0.0,NumOfCorrectResponses=2,NumOfIncorrectResponses=0,NumOfThreads=2,ProjectId=Testing,HostName=THERESA]
Perf add OK (4 total)
#> send
Sending sensor data (12/01 08:42:42)
  Activity: Send OK (No entries to send.)
  Ping: Ping OK (contacted server http://hackystat.ics.hawaii.edu/ with valid key.)
  Coverage: Send OK (No entries to send.)
  AutoSend: AutoSend OK ('send' command ignored)
  BuffTrans: Send OK (No entries to send.)
  UnitTest: Send OK (No entries to send.)
  Build: Send OK (No entries to send.)
  Perf: Send OK (4 entries)
  FileMetric: Send OK (No entries to send.)

26.23.4.3. Submit a trouble report

If none of the above troubleshooting activities solves your problem, then you should send an email to your Hackystat Administrator to request help. Please include in your email the following information:

  • The output from 'java -version'.

  • The output from 'java -jar sensorshell.jar -verify'.

  • The contents of your sensor.properties file.

  • The contents of the Perf.0.log file.

  • A description of the problem you are having.

26.23.5. Uninstallation

To disable HackyLoadTest sensor data collection temporarily, invoke HackyInstaller, bring up the HackyLoadTest configuration window, and uncheck the "Enable HackyLoadTest sensor" property, and apply the setting. To permanently uninstall the HackyLoadTest sensor, press the "Uninstall" button and remove the Build targets from your Ant build.xml files.