Determining Workflow Execution Duration Using Tracing
This topic demonstrates how to determine the time it takes for a successfully completed, self-hosted workflow to execute by using workflow tracing.
To determine workflow application execution duration by using workflow tracing
Open Visual Studio 2010. Select File, New, Project. Under C#, select the Workflow node. Select Workflow Console Application from the list of templates. Name the new project
WorkflowDurationTracingand click OK.
Open Workflow1.xaml. Drag a Delay activity onto the designer surface. Assign the value 00:00:10 (ten seconds) to the Duration property of the activity.
Open Event Viewer by clicking Start, Run, and entering
If you haven’t enabled workflow tracing, expand Applications and Services Logs, Microsoft, Windows, Application Server-Applications. Select View, Show Analytic and Debug Logs. Right-click Debug and select Enable Log. Leave Event Viewer open so that traces can be viewed after the workflow is run.
Execute the workflow application by pressing CTRL+SHIFT+B.
In Event Viewer, find a recent event with ID 1009 and a message similar to the following. Make a note of the time that the message was logged.
Parent Activity '', DisplayName: '', InstanceId: '' scheduled child Activity 'WorkflowDurationTracking.Workflow1', DisplayName: 'Workflow1', InstanceId: '1'.
- Find another recent event with ID 1001 and a message similar to the following. Subtract the previous message time from this message’s Logged value to determine workflow execution duration, which should be around 10 seconds.
WorkflowInstance Id: '1bbac57b-3322-498e-9e27-8833fda3a5bf' has completed in the Closed state.