Share via


Enabling the DCS Performance Counters

The DCS performance counters are disabled by default. You enable the DCS performance counters by modifying the configuration of the services that you want to monitor. The following sections describe the configuration entries that you should specify.

Enabling the Process Execution Performance Counters

To enable the Process Execution Performance counters, add the key performanceCountersEnabled with a value of true to the <appSettings> section in the configuration file for the service. The following code is an example of this section of a configuration file for a service.

<?xml version="1.0" encoding="utf=8"?>
<configuration>
    ...
    <appSettings>
        <add key "performanceCountersEnabled" value="true"/>
        ...
    </appSettings>
    ...
</configuration>

Enabling the Service Model Performance Counters

The Service Model Performance Counters are generated by using the Microsoft.ConnectedIndustry.ServiceModel.Application.Instrumentation.PerformanceBehaviorExtension class. To enable the Service Model Performance counters, set the performanceCountersEnabled key to true in the <appSettings> section of the configuration file for a service, and add a custom endpoint behavior to the configuration file for a service that references a <behaviorExtension> section that loads the PerformanceBehaviorExtension class. The code below shows an example of the relevant sections of a configuration file for a service.

<?xml version="1.0" encoding="utf=8"?>
<configuration>
    ...
    <appSettings>
        <add key "performanceCountersEnabled" value="true"/>
        ...
    </appSettings>

    <system.serviceModel>
        <behaviors>
            <behavior name="enablePerformanceCounters">
                <performanceCounters/>
            </behavior>
        </behaviors>
        ...
        <extensions>
            <add name="performanceCounters" type="Microsoft.ConnectedIndustry.ServiceModel.Application.Instrumentation.PerformanceBehaviorExtension, Microsoft.ConnectedIndustry.ServiceModel.Application, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
        </extensions>
    </system.serviceModel>
    ...
</configuration>