Copyright (c) 2007 Dorian Deng. Signature Sharing is not commercially available.
Reprinted please indicate the source: http://blog.csdn.net/doriandeng/archive/2007/09/28/1805614.aspx
The term "Measuring Instrument" refers to the ability of the system to monitor or measure performance and diagnose errors. For more information about measuring instruments, see publish an application in. net.ProgramMonitoring Design in.
The Enterprise Library includes the following measuring instruments in all application blocks:
- Event Logs
-
The Application Block notifies users of key events, such as errors and warnings.
- Performance counters
-
The Application Block record key dimension, such as the number of serious events generated per second or the average number of key tasks, is written to the performance calculator of the Microsoft Windows operating system.
- Windows Management Instrumentation (Wmi)
-
Application blocks report major events in the application blocks by publishing WMI events.
Available and unavailable Measuring Instrument
By default, the measuring instrument is unavailable. To make the measuring instrument available, you must install the Measuring Instrument Mode and configure the application.
Installation and uninstallation measure Mode
You can runInstallservices. bat
Batch file, or useStartIn the menuInstall InstrumentationShortcut. To use shortcuts, clickStart, PointingProgram,Microsoft patterns & Practices,Enterprise Library 3.1-May 2007And then clickInstall Instrumentation.
To uninstall the measuring instrument, you can include/U
Parameter runningInstallservices. bat
Batch files can also be usedStartIn the menuUninstall InstrumentationShortcut. To use shortcuts, clickStart, PointingProgram,Microsoft patterns & Practices,Enterprise Library 3.1-May 2007And then clickUninstall Instrumentation.
Note:
StartThe menu Link always runs binary with a strong name. Run [SRC install root] \ app blocks \ installservices. BAT to install the measuring instrument of the Assembly copy compiled from the source code.
Configure the application for the measuring instrument
Measuring Instrument by the application configuration file<Instrumentationconfiguration>This section determines the behavior of the measuring instrument on the entire application.
By default, all measuring instruments are unavailable. You can use the configuration to make the measuring instrument available, or if it was previously available to make it unavailable. All the measuring instrument attributes appear in the right panel. When the attribute is setTrueThe measuring instrument is available. When the attribute is not setFalseThe measuring instrument is unavailable.
Configuration Measuring Instrument
-
Start the configuration console. To start the configuration console, clickStart, PointingProgram,Microsoft patterns & Practices,Enterprise Library 3.1-May 2007And then clickEnterprise Library Configuration.
-
ClickNew ApplicationOrOpen existing application.
Right-clickApplication configuration, PointingNewAnd then clickInstrumentation.
-
SetEventloggingenabledAttribute, inputTrueOrFalseOr select one from the selected drop-down list. The default value isFalse.
-
SetPerformancecountersenabledAttribute. InputTrueOrFalseOr select one from the selected drop-down list. The default value isFalse.
-
SetWmienabledAttribute. InputTrueOrFalseOr select one from the selected drop-down list. The default value isFalse.