Performance Counters
Performance counters are strange beasts but can be quite useful in order to keep an eye on how custom code is performing in a production environment, and can be invaluable to support staff or infrastructure teams in diagnosing potential causes of system resource issues. There are a few 'gotchas' though and I will try to list as many of them as I can recall: Creating a new performance counter category should ideally be done by a separate utility as the new category cannot be used by your custom code directly after it has been created. Also the process creating the counter categories must have write access to the registry. Counter values will expire after the allotted time interval, so for example an AverageTimer counter type needs to be populated at least once every second otherwise you end up with zero values (and an ugly chart when using perfmon). Choosing the correct counter type is important, and remember that a lot of the hard work is done for you all you need to do is sup...