This project is read-only.

Resource Application Block Instrumentation

The Enterpirse Library plugs into three different instrumentation features: Performance Counters for performance monitoring, Event Logging for failure logging mainly and WMI Events again for tracking failures.

Instrumentation is configured through the Configuration Console

Adding Instrumentation

Once Instrumentation has been added to your configuration you can switch on the various features from the property window

Turning on Performance Counters

Performance Counters

The following tables describes the Resource Application Block performance counters:

Performance Counter Description
Total Resource Entries The total number of resources in a set
Total Resource Accesses The total number of resources accessed
Resource Access Rate The rate per second of resource accesses

If you have switched on Performance Counters through the Configuration Console then you can use Performance Monitor to track Resource Application Block usage by selecting the Performance administrative tool from the start menu.

Before you use the performance monitor you will need to load your application that uses the Resource Application Block. This is required so that performance monitor can attach itself to your resource manager instances.

When you load performance monitor, first remove the default counters and then add the Resource Application Block counters that you need. Select the computer that is running your application, select Enterprise Library Resource Counters from the performance object combo box and select any of the above listed performance counters from the counters list. Note: the instances list will show you all the resource manager instances that you have currently loaded.

Adding Resource Application Block Performance Counters

As you use your application you will see the performance monitor display the values of your counters graphically, showing things like the total number of resources in the current set, the total number of resources that your application has accessed since starting the monitor and the rate of access per second.

Monitoring Performance

Event Log Entries

If event logging is switched on then all Resource Application Block failures are logged to the Windows NT Application Event Log, the event log source name is Enterprise Library Resource and the entry is described as an Error. Logged events include the following:

Listener Event Exception Main Message Additional
ResourceInstrumentationListener Resource Failed true The error occurred using the instance name instance. Any general exception
DefaultResourceEventLogger Configuration error true The error occurred retrieving the configuration for instance instance name. errors from the Configuration Console
DefaultResourceEventLogger Resource error true The error occurred using the instance name instance. Alternative general exception handler

Resource Application Block Event Log Entries

WMI Events

With WMI Events switched on then the Resource Application Block is instrumented with the following Windows Management Instrumentation (WMI) events:
  • ResourceFailureEvent
  • ResourceConfigurationFailureEvent
All WMI events are registered under the namespace of root\EnterpriseLibrary
The following tables describe each WMI event's properties.

Table 1: ResourceFailureEvent Properties
WMI Property Description
ErrorMessage The error message that describes the failed caching activity.
ExceptionMessage The message for the exception that was raised when the caching activity failed.
InstanceName The ID of the cache manager that suffered the failure, as specified in the configuration file.
UtcTimeStamp The time that the caching activity failed.

Table 2: ResourceConfigurationFailureEvent Properties
WMI Property Description
ExceptionMessage The message for the exception that was raised when the attempt to create or configure a resource manager failed.
InstanceName The ID of the resource manager that could not be created or configured, as specified in the configuration file.
UtcTimeStamp The time that the configuration failure occurred.

A good tool to use is the WBEMTest tool available from the Windows O/S:

WBEMTest the WMI Test Tool

For more information see the documentation that comes with the Enterprise Library 3.1

Last edited Mar 2, 2008 at 6:20 PM by ewdev, version 15


No comments yet.