Enabling Instrumentation
Retired Content |
---|
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
The latest Enterprise Library information can be found at the Enterprise Library site. |
The term instrumentation refers to a system's ability to monitor or measure performance and to diagnose errors. Enterprise Library incorporates the following instrumentation into all of its application blocks except for the Unity Application Block:
- Event logs. The application blocks inform users of key events, such as errors or warnings.
- Performance counters. The application blocks record key metrics—such as the number of critical events that occur per second or the average time it takes to complete key tasks—by writing to the Microsoft Windows operating system performance counters.
- Windows Management Instrumentation (WMI). The application blocks report significant events within the application blocks by publishing WMI events.
For details of the design of the Enterprise Library instrumentation, see Instrumentation.
Enabling and Disabling Instrumentation
By default, instrumentation is disabled. To enable instrumentation, you must install the instrumentation schema and configure your application.
Installing and Uninstalling the Instrumentation Schema
To install the instrumentation schema, you can either run the InstallServices.bat batch file or you can use the Install Instrumentation shortcut on the Start menu. To use the shortcut, click Start, point to All Programs, point to Microsoft patterns & practices, point to Enterprise Library 4.1 — October 2008, and then click Install Instrumentation.
To uninstall instrumentation, you can either run the InstallServices.bat batch file with the /u parameter or you can use the Uninstall Instrumentation shortcut on the Start menu. To use the shortcut, click Start, point to All Programs, point to Microsoft patterns & practices, point to Enterprise Library 4.1 — October 2008, and then click Uninstall Instrumentation.
Note
The Start menu link always runs against the strong-named binaries. To install instrumentation against a copy of the assemblies compiled from the source code, run [Src install root]\App Blocks\InstallServices.bat.
Configuring an Application for Instrumentation
Instrumentation is controlled by the <instrumentationConfiguration> section of the application's configuration file. This section determines how instrumentation behaves for the entire application.
By default, each type of instrumentation is disabled. You can use configuration to enable each type of instrumentation or to disable instrumentation if you have previously enabled it. All instrumentation properties appear in the right pane. When a property is set to True, the instrumentation is enabled. When a property is set to False, the instrumentation is disabled.
To configure instrumentation
- Start the Configuration Console or the Visual Studio Configuration Editor. To use the Configuration Console, click Start, point to AllPrograms, point to Microsoftpatterns&practices, point to Enterprise Library 4.1 — October 2008, and then click Enterprise Library Configuration.
- Click New Application or Open Existing Application.
- Right-click Application Configuration, point to New, and then click Instrumentation.
- Set the EventLoggingEnabled property. Type or select True or False. The default value is False.
- Set the PerformanceCountersEnabled property. Type or select True or False. The default value is False.
- Set the WmiEnabled property. Type or select True or False. The default value is False.