Using PerformanceCounters for WCF service monitoring
PerformanceCounters are very useful components on Windows operating systems for application/service performance monitoring. WCF has provided plenty of built-in PerformanceCounters to help developers or administrators monitor the application performance and health more conveniently.
In this recipe, we will demonstrate how we can enable the WCF PerformanceCounters for a given WCF service application and monitor the values of specific WCF PerformanceCounters.
How to do it...
Now, let’s have a look at the detailed steps for utilizing the built-in PerformanceCounters in a WCF service application:
Turn on PerformanceCounters in the service diagnostics setting.
By default, WCF PerformanceCounters are not enabled so as not to involve additional performance hits for WCF service runtime. However, it is quite straightforward to turn on the PerformanceCounters for a given WCF application; we just need to set the
<diagnostics performanceCounters
/...