I'm glad to see that the Enterprise Library is “dog fooding“ itself. If you are unfamiliar with the term dog-fooding, it means that you eat your own dog food. Microsoft uses this technique with its newest product offerings by ensuring they are their first customers. When Exchange 2003 was released Microsoft rolled it out throughout its organization first....Does your company do that?
Anyway, the Enterprise Library uses itself to perform many services for other application blocks. This is impressive for a couple reasons. First of all circular references always popup when creating frameworks. For instance, if the logging application block needs to write to a database and your database needs to log errors...you have circular reference. Secondly, your other application blocks act as clients to your other application blocks (read: dog fooding)
I have just started my exploration of the Enterprise Library, but one thing that I've noticed is the use of Instrumentation. According to the docs, “The term instrumentation refers to the abilities to monitor or measure application performance and to diagnose errors.“ They “dog food“ the logging application block to...uh...log these.
The Enterprise Library instruments using 2 methods, Performance Monitors and WMI Events.
Here are a list of Performance Counters for the Data Access Application Block:
# of Command Failures/Sec. This counter displays the number of database commands that failed to execute by the Data Access Application Block.
# of Commands Executed/Sec. This counter displays the number of database commands executed by the Data Access Application Block per second.
# of Connection Failures/Sec. This counter displays the number of database connections that failed to be opened by the Data Access Application Block per second.
# of Connections Opened/Sec. This counter displays the number of database connections opened by the Data Access Application Block per second.
# of Transaction Failures/Sec. This counter displays the number of transactions that failed to be opened by the Data Access Application Block per second.
# of Transactions Aborted/Sec. This counter displays the number of database transactions rolled back by the Data Access Application Block per second.
# of Transactions Committed/Sec. This counter displays the number of database transactions committed by the Data Access Application Block per second.
# of Transactions Opened/Sec. This counter displays the number of database transactions opened by the Data Access Application Block per second.
Avg. Command Execution Time.
...and a list of WMI Events for the Data Access Application Block:
DataCommandFailedEvent. This event signifies that the Data Access Application Block has failed to execute a command. Includes the string property Command, which contains the failed data command if the information is available.
DataConnectionFailedEvent. This event signifies that the Data Access Application Block has failed to open a database connection.
DataConnectionOpenedEvent. This event signifies that the Data Access Application Block has successfully opened a database connection. Includes the string property ConfigurationFilePath, which contains the path of the main configuration file.
DataTransactionFailedEvent. This event signifies that the Data Access Application Block has failed to open a database transaction.
DataTransactionRolledBackEvent. This event signifies that a database transaction has been rolled back by the Data Access Application Block.
DataServiceFailureEvent. This class is a base class for data access failure events and includes the following properties:
ExceptionStackTrace (string). This property contains the stack trace of the reported exception.
ExceptionMessage (string). This property contains the detailed message of the exception and the exception stack trace if this failure is a result of an exception. DataServiceConfigFailureEvent. This event class inherits from the DataServiceFailureEvent. It signifies that required configuration information is missing or invalid. It includes the string property FailedConfigurationFile, which is the path to the bad configuration file, if the information is available.
I gotta run, but I'll write more when I learn it.
posted @ Sunday, January 30, 2005 7:47 AM