Getting Started

This is a step-by-step approach on how you might instrument a test case to capture performance data.

  1. Define the test case

    In order to detect performance regressions (or improvements!) historical data is needed. That data is recorded in a timer.xml file, organized by test case (scenario), and denoted by a unique test case number. This is a one time activity.
  2. Define your steps

    You will need to decide at what points in your test you would like to take performance snapshots. It may be as simple as the start and the end, or there may be specific operations that you are interested in. You may define some generic steps like before and after, or Wizard Started and Wizard Complete. Or you could create your own custom steps.


    Each step has a unique integer id. It is this id that you specify in the snapshot method.

  3. Alter your test case plugin.xml file to include the org.eclipse.perfmsr.core plug-in.

  4. Add snapshots to your code.

    Add this line: PerfMsrCorePlugin.getPerformanceMonitor(true).snapshot(step); to the points in your test case code where you want to take a snapshot.

  5. Run your test case.

    Run your test case as you normally would, but add the etools_perf_ctrl environment variable to configure and activate the performance instrumentation. For example:
    java -Detools_perf_ctrl="testd=51" rest-of-your-stuff

    If you don't want to specify the environment variable when you run your test, you can pass in the configuration information though an API instead. Here is an example of how you might do that.