Posted by: Cirilo Meggiolaro | 03/26/2009

Tip of the day #163 – Enable and disable performance counters for WWF services

The Tip #57 listed the Windows Workflow Foundation (WWF) performance counters available to help you out monitor the performance of your workflows. Performance counters are enabled by default so if you don’t need to perform any analysis or diagnostics you may disable it. Let’s take a look on how to do it

How to…

  • Create a custom section on the web.config file that represents your runtime configuration settings;
  • Define the new custom section and set the EnablePerformanceCounters attribute to false. The following snippet shows the config file:

<?xml version=1.0?>
      <section name=MyRuntimeSection           type=System.Workflow.Runtime.Configuration.WorkflowRuntimeSection,           System.Workflow.Runtime, Version=3.0.00000.0, Culture=neutral,           PublicKeyToken=31bf3856ad364e35 />
    <MyRuntimeSection Name=MyRuntime EnablePerformanceCounters=false />

  • In your code, when you create an instance of the WorkflowRuntime object, use a constructor overload that accepts the config section name:

using (WorkflowRuntime runtime = new WorkflowRuntime(“MyRuntimeSection”)) { }

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: