Programmatically Displaying and Configuring the Profiler

There is at most one profiler per TestStand application process. Accessing any static method or property of the class NationalInstruments.TestStandProfiler.Profiler from the <TestStand>\Tools\Profiler\$(Platform)\Profiler.dll assembly, except for the Close() method and the IsOpen property, automatically creates the profiler if needed before performing the specified action. Call the Close() method to close the profiler window and discard its data. The Comparing Resource Usage Strategies.seq file in the <TestStand>\Examples\Parallel Testing\Comparing Resource Usage Strategies directory contains a SequenceFileLoad callback sequence that contains example steps that launch and configure the profiler.

The Profiler enables you to programmatically:

  • Load and Save profiler data
  • Clear the profiler window
  • Specify what types of information the profiler collects and displays
  • Start of stop data collection and data display
  • Activate, select data, and copy information from a specified table or graph
  • Set other options, such as time units, window size and position, and splitter bar location

For example, to isolate a section of your sequence for profiling, you might insert a step before the section that sets Profiler.DataCollectionEnabled and a step at the end of the section, which clears Profiler.DataCollectionEnabled.

Note   To prevent the execution of steps that control the profiler from appearing within the profile data, you can mark them for exclusion from profiling. Refer to the Excluding Items from Profiling topic for more information.