Most of the applications developed with Microsoft technology use the .NET framework. This framework provides a good platform for both the development and running of applications. It also provides counters to measure and monitor performance of the applications.
The .NET Framework has two main components:
- The common language runtime
- The .NET Framework class library
The common language runtime (CLR) is the foundation of the .NET Framework. You can think of the runtime as an agent that manages code at execution time, providing core services such as memory management, thread management, and remoting, while also enforcing strict type safety and other forms of code accuracy that promote security and robustness. In fact, the concept of code management is a fundamental principle of the runtime. Code that targets the runtime is known as managed code, while code that does not target the runtime is known as unmanaged code. The class library, the other main component of the .NET Framework, is a comprehensive, object-oriented collection of reusable types.
The runtime is designed to enhance performance. Although the common language runtime provides many standard runtime services, managed code is never interpreted. A feature called just-in-time (JIT) compiling enables all managed code to run in the native machine language of the system on which it is executing. Meanwhile, the memory manager removes the possibilities of fragmented memory and increases memory locality-ofreference to further increase performance.
Performance counters are organized and grouped into performance counter categories. In general, just as the Windows operating system provides many predefined performance counters that can be retrieved programmatically or displayed using the Performance Monitor, in .NET the CLR exposes its own set of performance counters. They are organized into nine important categories to help the tester monitor and tune the application’s performance. They are:
- Exceptions. Provides information about the exceptions thrown by the application.
- Memory. Provides information about the garbage collector.
- Locks and Threads. Provide information about managed locks and threads used by the application.
- Interop. Provides information about the application’s interaction with COM components, COM+ services, and type libraries.
- JIT. Provides information about code that has been compiled by the just-in-time (JIT) compiler.
- Loading. Provides information about assemblies, classes, and AppDomains that have been loaded.
- Networking. Provides information about the data sent and received over the network by the application.
- Remoting. Provides information about remote objects used by the application.
- Security. Gives a description about the security checks the CLR performs on the application.