20.1. Performance Counters

It is generally quite difficult to determine exactly which performance counters are required to effectively monitor a system or application. Once you have a reasonable idea of what the application is going to perform, you can look for areas where performance counters can provide beneficial information for operations. In most cases, during live-service monitoring, performance counters are used to actually generate events by placing thresholds around their values. This is usually implemented via the operational monitoring tools. For example, if a performance counter reaches a certain value, a warning event is raised; if it progresses to another value, an error is raised; and so forth. This is not generally coded into the application, as modern monitoring solutions are usually very good at this kind of "roll up" and rule-based analysis. However, the operating system can also provide its own analysis. For example, when the amount of free disk space is reduced, the system generates a "Low Disk Space" warning event and suggests freeing up more disk space. The operating system doesn't contain a full-blown monitoring solution, of course. The application needs to provide the counters necessary to profile and monitor the application during both testing and live service.

Each performance counter is of a specified type, as follows:

  • NumberOfItems(32 or 64 bit) — This counter type contains a value pertaining to the latest number of items or operations. For example, ...

Get Design – Build – Run: Applied Practices and Principles for Production-Ready Software Development now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.