Enabling Performance Counters

Performance counters are a mechanism for monitoring services that you can get without changing any code, but you have to ask for them. The values of performance counters give you real-time monitoring information about the operational characteristics of your services. You can control performance counters through configuration.

<diagnostics performanceCounters="All" />

The possible settings for the scope of service counters are Off, ServiceOnly, and All. For the actual performance counters, the scopes are finer grained, with different naming schemes depending on the type of data that the performance counter monitors.

  • Service scope performance counters look like Service@Address
  • Endpoint scope performance counters look like Service.Contract@Address
  • Operation scope performance counters look like Service.Contract.Operation@Address

The address is based on the external address of the object being monitored, with some modifications. The addresses are normalized by capitalizing them, replacing certain characters (the forward path separator is replaced by a pipe symbol, for example), and then mangling the address so that it is both short and unique. Addresses that are already short remain essentially readable while addresses that are more than a few dozen characters come out considerably worse for wear.

Next time: Svcutil Tips

Comments (5)

  1. You have talked in the past about how a service has both local settings and settings that are shared

  2. Just found some useful information: – Extensions to EntLib 3.1 done as as community effort: http://blogs.msdn.com/tomholl/archive/2007/07/17/first-release-of-entlib-contrib.aspx

  3. Irwin says:

    Hey Nick,

    U need to edit that, it should be

    ‘<diagnostics performanceCounters="All" />’.

    When i used ‘performanceCountersEnabled’, WCF kicked up a fuss.

  4. You’re correct.  Adding Enabled is a common typo because that’s how the WMI setting is named.

Skip to main content