Mapping Application Block Instrumentation

The Enterprise 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 Mapping Application Block performance counters:

Performance Counter Description
Total Mapping to Domain Object Count The total number of mappings from DTO to domain object
Custom Mapping to Domain Object Count The number of Custom mappings from DTO to domain object
Basic Mapping to Domain Object Count The number of Basic mappings from DTO to domain object
Super Mapping to Domain Object Count The number of Super mappings from DTO to domain object
Total Mapping from Domain Object Count The total number of mappings from domain object to DTO
Custom Mapping from Domain Object Count The number of Custom mappings from domain object to DTO
Basic Mapping from Domain Object Count The number of Basic mappings from domain object to DTO
Super Mapping from Domain Object Count The number of Super mappings from domain object to DTO
Mapping to Domain Object Rate The rate of mappings from DTO to domain object per second
Custom Mapping to Domain Object Rate The rate of Custom mappings from DTO to domain object per second
Basic Mapping to Domain Object Rate The rate of Basic mappings from DTO to domain object per second
Super Mapping to Domain Object Rate The rate of Super mappings from DTO to domain object per second
Mapping from Domain Object Rate The rate of mappings from domain object to DTO per second
Custom Mapping from Domain Object Rate The rate of Custom mappings from domain object to DTO per second
Basic Mapping from Domain Object Rate The rate of Basic mappings from domain object to DTO per second
Super Mapping from Domain Object Rate The rate of Super mappings from domain object to DTO per second


If you have switched on Performance Counters through the Configuration Console then you can use Performance Monitor to track Mapping 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 Mapping Application Block. This is required so that performance monitor can attach itself to your mapping instances.

When you load performance monitor, first remove the default counters and then add the Mapping Application Block counters that you need. Select the computer that is running your application, select Enterprise Library Mapping 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 mapping instances that you have currently loaded.

Adding Mapping 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 data reads, the total number of records that your application has accessed from a relational database since starting the monitor, total number of file reads and the total number of records read from files as in this example below.

Monitoring Performance

Event Log Entries

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

Listener Event Exception Main Message Additional
MappingInstrumentationListener MapperFailed true The error occurred using the instance name instance. Any general exception
DefaultMapperEventLogger MapperConfigurationFailure true The error occurred retrieving the configuration for instance instance name. Errors from the Configuration Console
DefaultMapperEventLogger MapperFailure true The error occurred using the instance name instance. Alternative general exception handler


Mapping Application Block Event Log Entries

WMI Events

I put a lot of effort into these things for my other two blocks RAB and QAB and have yet to meet anyone who uses them. I certainly don't! So I have not bothered for the MAB.

Active Directory Group Policy

As above for WMI events. Also I could not think of any scenario where group policies would make sense for the MAB.

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

Last edited Jun 20, 2010 at 1:10 AM by ewdev, version 7

Comments

No comments yet.