Using Quantify with Scripts

Related Topics

You can modify existing batch files and Perl scripts to collect performance data as they execute. The following examples show some ways that you can use Quantify command-line options to control data collection from within a batch file or script.

For .NET managed code and Visual Basic p-code programs, add the following line to have a test script profile your program using filters contained in the filter file Test_vbharness.qft, and then to save the data to an ASCII text file:

quantify /SaveTextData /FilterFiles=test_vbharness.qft /net pcode_app.exe

For Visual C++ and Visual Basic native-code (unmanaged) programs, you can add this line to the beginning of a test script:

quantify /Run=no /Replace=yes hello.exe

The test script now instructs Quantify to instrument the program Hello.exe without running the instrumented program. Quantify saves the original program to Exename.exe.original and replaces it with the instrumented version, Exename.exe.

To run the instrumented version, filter data using filters contained in the Quantify filter file (.qft) Test_harness.qft, and save the performance data to an ASCII text file (.txt) so the script can work with it, add the following line:

quantify /SaveTextData /FilterFiles=test_harness.qft hello.exe

Notes:

§      To run programs from the command line, you must have the Rational/common directory in your PATH environment variable.

§      If you run your test script continuously, make sure each run of the script starts with the uninstrumented version of the program.

§      To use a script to analyze performance data, modify the script to search the collected data for records that meet specific criteria. For example, a script can raise a failure condition if a subtree runs for longer than a specified amount of time.

§      If you are using Microsoft Windows 2000 or higher, the Windows File Protection feature (WFP) may cause problems when you use Quantify's /replace command line option. For a workaround to this problem, click images\shortcut.gif.

(C) Copyright IBM Corporation 1993, 2009.