.NET Performance Counters

I l @ ve RuBoard

The following sections describe the common .NET performance counters that you're likely to be interested in for observing your applications.

.NET CLR Data

The SQL Server .NET Data Provider adds several performance counters that enable you to fine-tune connection pooling characteristics, detect intermittent problems related to failed connection attempts, and detect problems related to timed-out requests to your SQL Server. Table C-1 describes the connection pooling counters in the .NET CLR Data category.

Table C-1. SQL Connection Pooling Counters

Counter

Description

SqlClient: Current # of pooled and non pooled connections

Current number of connections, pooled or not.

SqlClient: Current # pooled connections

Current number of connections in all pools associated with the process.

SqlClient: Current # connection pools

Current number of pools associated with the process.

SqlClient: Peak # pooled connections

The highest number of connections in all pools since the process started. (This counter is available only when associated with a specific process instance. The _Global instance will always return 0.

SqlClient: Total # failed connects

The total number of connection open attempts that have failed for any reason.

.NET CLR Exceptions

The Performance console's .NET CLR Exceptions category includes counters that provide information about the exceptions thrown by an application. Table C-2 describes these performance counters.

Table C-2. Counters Related to Exceptions

Counter

Description

# of Exceps Thrown

Displays the total number of exceptions thrown since the application started. This includes both .NET exceptions and unmanaged exceptions that are converted into .NET exceptions. For example, an HRESULT returned from unmanaged code is converted to an exception in managed code.

This counter includes both handled and unhandled exceptions. Exceptions that are rethrown are counted again.

# of Exceps Thrown / Sec

Displays the number of exceptions thrown per second. This includes both .NET exceptions and unmanaged exceptions that are converted into .NET exceptions. For example, an HRESULT returned from unmanaged code is converted to an exception in managed code.

This counter includes both handled and unhandled exceptions. It is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval. This counter is an indicator of potential performance problems if a large number of exceptions (several hundred or more) are thrown.

# of Filters / Sec

Displays the number of .NET exception filters executed per second. An exception filter evaluates regardless of whether an exception is handled.

This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

# of Finallys / Sec

Displays the number of finally blocks executed per second. A finally block is guaranteed to be executed regardless of how the try block was exited.

This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Throw to Catch Depth / Sec

Displays the number of stack frames traversed, from the frame that threw the exception to the frame that handled the exception, per second. This counter resets to zero when an exception handler is entered, so nested exceptions show the handler-to-handler stack depth.

This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

.NET CLR Interop

The Performance console's .NET CLR Interop category includes counters that provide information about an application's interaction with COM components , COM+ services, and external type libraries. Table C-3 describes these performance counters.

Table C-3. .NET CLR Interop Performance Counters

Counter

Description

# of CCWs

Displays the current number of COM Callable Wrappers (CCWs). A CCW is a proxy for a managed object being referenced from an unmanaged COM client. This counter indicates the number of managed objects referenced by unmanaged COM code.

# of marshalling

Displays the total number of times arguments and return values have been marshaled from managed to unmanaged code, and vice-versa, since the application started. This counter is not incremented if the stubs are inlined. (Stubs are responsible for marshaling arguments and return values.) Stubs are usually inlined if the marshaling overhead is small.

# of Stubs

Displays the current number of stubs created by the common language runtime. Stubs are responsible for marshaling arguments and return values from managed to unmanaged code, and vice-versa, during a COM interop call or a Platform Invoke call.

# of TLB exports / sec

Reserved for future use.

# of TLB imports / sec

Reserved for future use.

.NET CLR JIT

The Performance console's .NET CLR JIT category includes counters that provide information about code that has been JIT-compiled. Table C-4 describes these performance counters.

Table C-4. .NET CLR JIT Performance Counters

Counter

Description

# of IL bytes JITted

Displays the total number of Microsoft intermediate language (MSIL) bytes compiled by the just-in-time (JIT) compiler since the application started. This counter is equivalent to the Total # of IL Bytes Jitted counter.

# of IL methods JITted

Displays the total number of methods JIT-compiled since the application started. This counter does not include pre-JIT-compiled methods.

% Time in Jit

Displays the percentage of elapsed time spent in JIT compilation since the last JIT compilation phase. This counter is updated at the end of every JIT compilation phase. A JIT compilation phase occurs when a method and its dependencies are compiled.

IL bytes Jitted / sec

Displays the number of MSIL bytes that are JIT-compiled per second. This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Standard Jit Failures

Displays the peak number of methods the JIT compiler has failed to compile since the application started. This failure can occur if the MSIL cannot be verified or if there is an internal error in the JIT compiler.

Total # of IL Bytes Jitted

Displays the total MSIL bytes JIT-compiled since the application started. This counter is equivalent to the # of IL Bytes Jitted counter.

.NET CLR Loading

The Performance console's .NET CLR Loading category includes counters that provide information about assemblies, classes, and application domains that are loaded. Table C-5 describes these performance counters.

Table C-5. .NET CLR Loading Performance Counters

Counter

Description

% Time Loading

Reserved for future use.

Assembly Search Length

Reserved for future use.

Bytes in Loader Heap

Displays the current size , in bytes, of the memory committed by the class loader across all application domains. Committed memory is the physical space reserved in the disk paging file.

Current appdomains

Displays the current number of application domains loaded in this application.

Current Assemblies

Displays the current number of assemblies loaded across all application domains in the currently running application. If the assembly is loaded as domain-neutral from multiple application domains, this counter is incremented only once.

Current Classes Loaded

Displays the current number of classes loaded in all assemblies.

Rate of appdomains

Displays the number of application domains loaded per second. This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Rate of appdomains unloaded

Displays the number of application domains unloaded per second. This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Rate of Assemblies

Displays the number of assemblies loaded per second across all application domains. If the assembly is loaded as domain-neutral from multiple application domains, this counter is incremented only once.

This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Rate of Classes Loaded

Displays the number of classes loaded per second in all assemblies. This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Rate of Load Failures

Displays the number of classes that failed to load per second. Load failures can occur for many reasons, such as inadequate security or invalid format. For details, see the profiling services Help.

This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Total # of Load Failures

Displays the peak number of classes that have failed to load since the application started.

Load failures can occur for many reasons, such as inadequate security or invalid format. For details, see the profiling services Help.

Total Appdomains

Displays the peak number of application domains loaded since the application started.

Total appdomains unloaded

Displays the total number of application domains unloaded since the application started. If an application domain is loaded and unloaded multiple times, this counter will increment each time the application domain is unloaded.

Total Assemblies

Displays the total number of assemblies loaded since the application started. If the assembly is loaded as domain-neutral from multiple application domains, this counter will be incremented only once.

Total Classes Loaded

Displays the cumulative number of classes loaded in all assemblies since the application started.

.NET CLR LocksAndThreads

The Performance console's .NET CLR LocksAndThreads category includes counters that provide information about managed locks and threads that an application uses. Table C-6 describes these performance counters.

Table C-6. .NET CLR LocksAndThreads Performance Counters

Counter

Description

# of current logical Threads

Displays the number of current managed thread objects in the application. This counter maintains the count of both running and stopped threads. This counter is not an average over time; it displays only the last observed value.

# of current physical Threads

Displays the number of native operating system threads created and owned by the common language runtime to act as underlying threads for managed thread objects. This counter's value does not include the threads used by the runtime in its internal operations; it is a subset of the threads in the operating system process.

# of current recognized threads

Displays the number of threads that are currently recognized by the runtime. These threads are associated with a corresponding managed thread object. The runtime does not create these threads, but they have run inside the runtime at least once.

Only unique threads are tracked; threads with the same thread ID that reenter the runtime or are re-created after the thread exits are not counted twice.

# of total recognized Threads

Displays the total number of threads that have been recognized by the runtime since the application started. These threads are associated with a corresponding managed thread object. The runtime does not create these threads, but they have run inside the runtime at least once.

Only unique threads are tracked; threads with the same thread ID that reenter the runtime or are re-created after the thread exits are not counted twice.

Contention Rate / Sec

Displays the rate at which threads in the run ­time attempt to acquire a managed lock ­unsuccessfully.

Current Queue Length

Displays the total number of threads that are currently waiting to acquire a managed lock in the application. This counter is not an average over time; it displays the last observed value.

Queue Length / Sec

Displays the number of threads per second that are waiting to acquire a lock in the application. This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Queue Length Peak

Displays the total number of threads that have waited to acquire a managed lock since the application started.

Rate of recognized threads / Sec

Displays the number of threads per second that have been recognized by the runtime. These threads are associated with a corresponding managed thread object. The runtime does not create these threads, but they have run inside the runtime at least once.

Only unique threads are tracked; threads with the same thread ID that reenter the runtime or are re-created after the thread exits are not counted twice.

This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Total # of Contentions

Displays the total number of times that threads in the runtime have attempted to acquire a managed lock unsuccessfully.

.NET CLR Memory

The Performance console's .NET CLR Memory category includes counters that provide information about the garbage collector. Table C-7 describes these performance counters.

Table C-7. .NET CLR Memory Performance Counters

Counter

Description

# Bytes in all Heaps

Displays the sum of the Gen 0 Heap Size, Gen 1 Heap Size, Gen 2 Heap Size, and the Large Object Heap Size counters. This counter indicates the current memory allocated in bytes on the garbage collection heaps.

# GC Handles

Displays the number of garbage collection handles in use. Garbage collection handles are handles to resources external to the common language runtime and the managed environment.

# Gen 0 Collections

Displays the number of times the generation 0 objects (that is, the youngest, most recently allocated objects) are garbage-collected since the application started.

Generation 0 garbage collection occurs when the available memory in generation 0 is not sufficient to satisfy an allocation request. This counter is incremented at the end of a generation 0 garbage collection. Higher-generation garbage collections include all lower-generation collections. This counter is explicitly incremented when a higher-generation (generation 1 or 2) garbage collection occurs.

This counter displays the last observed value. The _Global_ counter value is not accurate and should be ignored.

# Gen 1 Collections

Displays the number of times the generation 1 objects have been garbage-collected since the application started.

The counter is incremented at the end of a generation 1 garbage collection. Higher-generation garbage collections include all lower-generation collections. This counter is also incremented when a higher-generation (generation 2) garbage collection occurs.

This counter displays the last observed value. The _Global_ counter value is not accurate and should be ignored.

# Gen 2 Collections

Displays the number of times the generation 2 objects have been garbage-collected since the application started. The counter is incremented at the end of a generation 2 garbage collection (also called a full garbage collection).

This counter displays the last observed value. The _Global_ counter value is not accurate and should be ignored.

# Induced GC

Displays the peak number of times garbage collection was performed because of an explicit call to GC.Collect . It is good practice to let the garbage collector tune the frequency of its collections.

# of Pinned Objects

Displays the number of pinned objects encountered in the last garbage collection. A pinned object is one that the garbage collector cannot move in memory. This counter tracks the pinned objects only in the heaps that are garbage-collected. For example, a generation 0 garbage collection causes enumeration of pinned objects only in the generation 0 heap.

# of Sink Blocks in use

Displays the current number of synchronization blocks in use. Synchronization blocks are per-object data structures allocated for storing synchronization information. Synchronization blocks hold weak references to managed objects and must be scanned by the garbage collector. Synchronization blocks are not limited to storing synchronization information; they can also store COM Interop metadata. This counter indicates performance problems with heavy use of synchronization primitives.

# Total committed Bytes

Displays the amount of virtual memory, in bytes, currently committed by the garbage collector. Committed memory is the physical memory for which space has been reserved in the disk paging file.

# Total reserved Bytes

Displays the amount of virtual memory, in bytes, currently reserved by the garbage collector. Reserved memory is the virtual memory space reserved for the application but no disk or main memory pages have been used.

% Time in GC

Displays the percentage of elapsed time that was spent performing a garbage collection since the last garbage collection cycle. This counter usually indicates the work done by the garbage collector to collect and compact memory on behalf of the application. This counter is updated only at the end of every garbage collection. This counter is not an average; its value reflects the last observed value.

Allocated Bytes/Second

Displays the number of bytes per second allocated on the garbage collection heap. This counter is updated at the end of every garbage collection, not at each allocation. This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Finalization Survivors

Displays the number of garbage-collected objects that have survived a collection because they are waiting to be finalized. If these objects hold references to other objects, those objects also survive but are not counted by this counter. The Promoted Finalization-Memory from Gen 0 and Promoted Finalization-Memory from Gen 1 counters represent all the memory that survived due to finalization.

This counter is not cumulative; it is updated at the end of every garbage collection with the count of the survivors during that particular collection only. This counter indicates the extra overhead that the application might incur because of finalization.

Gen 0 heap size

Displays the maximum bytes that can be allocated in generation 0; it does not indicate the current number of bytes allocated in generation 0.

A generation 0 garbage collection occurs when the allocations since the last collection exceed this size. The generation 0 size is tuned by the garbage collector and can change during the execution of the application. At the end of a generation 0 collection, the size of the generation 0 heap is 0 bytes. This counter displays the size, in bytes, of allocations that invokes the next generation 0 garbage collection.

This counter is updated at the end of a garbage collection, not at each allocation.

Gen 0 Promoted Rules/Sec

Displays the bytes per second that are promoted from generation 0 to generation 1. Memory is promoted when it survives a garbage collection. This counter is an indicator of relatively long-lived objects being created per second.

This counter displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Gen 1 heap size

Displays the current number of bytes in generation 1; this counter does not display the maximum size of generation 1. Objects are not directly allocated in this generation; they are promoted from previous generation 0 garbage collections. This counter is updated at the end of a garbage collection, not at each allocation.

Gen 1 Promoted Bytes/Sec

Displays the bytes per second that are promoted from generation 1 to generation 2. Objects that are promoted only because they are waiting to be finalized are not included in this counter.

An object is promoted when it survives a garbage collection. Nothing is promoted from generation 2 because it is the oldest generation. This counter is an indicator of very long-lived objects being created per second.

This counter displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Gen 2 heap size

Displays the current number of bytes in generation 2. Objects are not directly allocated in this generation; they are promoted from generation 1 during previous generation 1 garbage collections. This counter is updated at the end of a garbage collection, not at each allocation.

Large Object Heap size

Displays the current size, in bytes, of the Large Object Heap. Objects greater than 20 KB are treated as large objects by the garbage collector and are directly allocated in a special heap; they are not promoted through the generations. This counter is updated at the end of a garbage collection, not at each allocation.

Promoted Finalization-Memory ­ from Gen 0

Displays the bytes of memory that are promoted from generation 0 to generation 1 only because they are waiting to be finalized. This counter is not cumulative; it displays the value observed at the end of the last garbage collection.

Promoted Finalization-Memory ­ from Gen 1

Displays the bytes of memory that are promoted from generation 1 to generation 2 only because they are waiting to be finalized. This counter is not cumulative; it displays the value observed at the end of the last garbage collection. This counter is reset to 0 if the last garbage collection was a generation 0 collection only.

Promoted Memory from Gen 0

Displays the bytes of memory that survive garbage collection and are promoted from generation 0 to generation 1. Objects that are promoted only because they are waiting to be finalized are not included in this counter. This counter is not cumulative; it displays the value observed at the end of the last garbage collection.

Promoted Memory from Gen 1

Displays the bytes of memory that survive garbage collection and are promoted from generation 1 to generation 2. Objects that are promoted only because they are waiting to be finalized are not included in this counter. This counter is not cumulative; it displays the value observed at the end of the last garbage collection. This counter is reset to 0 if the last garbage collection was a generation 0 collection only.

.NET CLR Networking

The Performance console's .NET CLR Networking category includes counters that provide information about data that an application sends and receives over the network. Table C-8 describes these performance counters.

Table C-8. .NET CLR Networking Performance Counters

Counter

Description

Bytes Received

Displays the cumulative number of bytes received over all open socket connections since the process started. This number includes data and any protocol information that is not defined by TCP/IP.

Bytes Sent

Displays the cumulative number of bytes sent over all open socket connections since the process started. This number includes data and any protocol information that is not defined by TCP/IP.

Connections Established

Displays the cumulative number of socket connections established for this process since it started.

Datagrams Received

Displays the cumulative number of datagram packets received since the process started.

Datagrams Sent

Displays the cumulative number of datagram packets sent since the process started.

.NET CLR Remoting

The Performance console's .NET CLR Remoting category includes counters that provide information about the remoted objects that an application uses. Table C-9 describes these performance counters.

Table C-9. .NET CLR Remoting Performance Counters

Counter

Description

Channels

Displays the total number of remoting channels registered across all application domains since application started. Channels transport messages to and from remote objects.

Context Proxies

Displays the total number of remoting proxy objects in this process since it started. A proxy object acts as a representative of the remote objects and ensures that all calls made on the proxy are forwarded to the correct remote object.

Context Bound Classes Loaded

Displays the current number of context-bound classes that are loaded. Classes that can be bound to a context are called context-bound classes. Context-bound classes are marked with context attributes, which provide usage rules for synchronization, thread affinity, transactions, and so on.

Context-Bound Objects Alloc / sec

Displays the number of context-bound objects allocated per second. Classes that can be bound to a context are called context-bound objects. Context-bound classes are marked with context attributes, which provide usage rules for synchronization, thread affinity, transactions, and so on.

This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Contexts

Displays the current number of remoting contexts in the application. A context is a boundary containing a collection of objects with the same usage rules such as synchronization, thread affinity, transactions, and so on.

Remote Calls / sec

Displays the number of remote procedure calls invoked per second. A remote procedure call is a call on any object outside the caller's application domain. This counter is not an average over time; it displays the difference between the values observed in the last two samples divided by the duration of the sample interval.

Total Remote Calls

Displays the total number of remote procedure calls invoked since the application started. A remote procedure call is a call on any object outside the caller's application domain.

.NET CLR Security

The Performance console's .NET CLR Security category includes counters that provide information about the security checks that the common language runtime performs for an application. Table C-10 describes these performance counters.

Table C-10. .NET CLR Security Performance Counters

Counter

Description

# Link Time Checks

Displays the total number of link-time code access security checks since the application started. Link-time code access security checks are performed when a caller demands a particular permission at just-in-time (JIT) compile time. A link-time check is performed once per caller. This count is not indicative of serious performance issues; it is merely indicative of the security system activity.

% Time in RT checks

Displays the percentage of elapsed time spent performing runtime code access security checks since the last sample. This counter is updated at the end of a .NET Framework security check. It is not an average; it represents the last observed value.

% Time Sig Authenticating

Reserved for future use.

Stack Walk Depth

Displays the depth of the stack during that last runtime code access security check. Runtime code access security checks are performed by walking the stack. This counter is not an average; it displays only the last observed value.

Total Runtime Checks

Displays the total number of runtime code access security checks performed since the application started. Runtime code access security checks are performed when a caller demands a particular permission. The runtime check is made on every call by the caller and examines the current thread stack of the caller. When used with the Stack Walk Depth counter, this counter indicates the performance penalty that occurs for security checks.

I l @ ve RuBoard


Designing Enterprise Applications with Microsoft Visual Basic .NET
Designing Enterprise Applications with Microsoft Visual Basic .NET (Pro-Developer)
ISBN: 073561721X
EAN: 2147483647
Year: 2002
Pages: 103

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net