AQTime normally generates results once the profiled application has ended its run. When profiling a dynamic link library, this means results are generated when the host application exits.
However, you might be profiling an application that does not stop until the system shuts down (for example, a Windows service), or you may wish to obtain results without closing the running application (for instance, the host for a dll).
You can command AQTime to generate results by using the Get Results menu item, by using specific actions, or by controlling AQTime from your application. This topic describes all of these ways and also provides a brief overview of the Clear Results feature.
Get Results Command
To command AQTime to generate profiling results, you can do any of the following:
-
Click Get Results on the Standard toolbar.
-
Select Run > Get Results from the main menu of AQTime.
-
Press CTRL-R (the shortcut can be changed via the Customize Keyboard dialog.)
Note: | The shortcut set for the Get Results command does not work during the profiling if the profiled application’s window is active. To use the shortcut, activate the AQTime window. |
To command AQTime to generate profiling results, select the AQTime > Get Results item from Visual Studio’s main menu or press Get Results on the AQTime toolbar.
To command AQTime to generate profiling results, select AQTime > Get Results from RAD Studio’s main menu. Results will be generated as if the profiled application had terminated.
Using Specific Actions
By using AQTime actions you can configure the profiler run so that AQTime will perform the following specific operations upon entering or exiting a routine:
So, you can create an action of the Get results type and add the desired routine or routines to this action. The routine(s) that you select for the action must be executed during the profiler run. Depending on the Execution Type property of the action, AQTime will generate results upon entering or existing the routine(s) added to the action.
For more information on actions, see Using Actions.
Commanding AQTime to Generate Results via COM
AQTime is a COM server. You may connect to it via COM and use the COM interfaces command to command the profiling engine to generate results. The whole procedure includes the following steps:
-
Connect to AQTime via COM (you can use the AQtime.AQtime program identifier).
-
Obtain the
IntegrationManager
object. -
To generate results, call the
TakeSnapshot
method of theIntegrationManager
object.
For more information on the IntegrationManager
object and the TakeSnapshot
method, see Working With AQTime via COM.
Commanding AQTime to Generate Results from a Tested Application
You may also command AQTime to generate results from your profiled application. To do this:
-
Open your application’s project in the development tool you use.
-
Include the AQTimeHelpers file into your application project. This file is located in the following folder:
If you use... Add the following file Microsoft Visual C# .NET <AQTime 8 SDK>\CS\AQTimeHelpers.cs Microsoft Visual Basic .NET <AQTime 8 SDK>\VBNET\AQTimeHelpers.vb Microsoft Visual C++, Borland C++Builder, Borland C++ or Intel C++ <AQTime 8 SDK>\CPP\Common\AQTimeHelpers.cpp Microsoft Visual Basic <AQTime 8 SDK>\VB\AQTimeHelpers.bas Borland Delphi <AQTime 8 SDK>\Delphi\Common\AQTimeHelpers.pas On Windows Vista and later operating systems AQTime SDK files are located in the <Users>\Public\Documents\AQTime 8 SDK folder. On other operating systems the files reside in the <Documents and Settings>\All Users\Documents\AQTime8 SDK folder. Note that the All Users\Documents folder may be displayed in Windows Explorer and the Open and the Save dialogs as All Users\Shared Documents.
The file contains the declaration of the
GenerateResults
function. This function commands AQTime to generate and display profiling results that have been accumulated by the call. The function does not use any parameters. -
Call the
GenerateResults
function in your code.If your application already contains a routine with the name
GenerateResults
, you may need to use theAQTimeHelpers
namespace or theAQTimeHelpers
unit name (this depends on your compiler) when calling theGenerateResults
routine:Visual C++
. . .
// Call GenerateResults using the namespace
AQTimeHelpers::GenerateResults();Delphi
. .
// Call GenerateResults using the unit name
AQTimeHelpers.GenerateResults();
About Clearing the Results
Note that if you do not want to keep the previous results, you can flush them before getting the most recent results. This can be done by selecting the Run > Clear Results item from AQTime’s main menu or by pressing the Clear Results button on the Standard toolbar.selecting the AQTime > Clear Results item from Visual Studio’s main menu or with the Clear Results button on the AQTime toolbar.selecting AQTime > Clear Results from RAD Studio’s main menu. See Clearing Results During Profiling for more information on this.
See Also
Profiling Web Server Applications
Profiling IIS Applications
Profiling ASP.NET Applications
Profiling Services
Process Terminating Restriction
Clearing Results During Profiling