Enterprise Library - Instrumentation

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

Print

Comments on this entry:

# re: Enterprise Library - Instrumentation

Left by Person who can spell at 5/11/2007 12:13 AM
Gravatar

Hi, good article, except it makes for frustrating reading in the first paragraphs due to spelling & grammer mistakes:

unformiliar = unfamiliar
technic = technique
costumers = customers
through out = throughout (one word)
it's = its (possessive)

I would suggest next time writing your article in a word processor and then pasting into your blog.

# re: Enterprise Library - Instrumentation

Left by Tim Gifford at 5/11/2007 6:57 AM
Gravatar

Thanks for the edits. I've updated the post so it doesn't annoy you anymore.

I've never claimed to be a professional writer/editor...obviously!

# re: Enterprise Library - Instrumentation

Left by Damian at 7/23/2007 2:22 AM
Gravatar

Look who's talking!!!

Grammer is an actor... grammar is the right spelling of the word you wanted to use.

# re: Enterprise Library - Instrumentation

Left by Mayri at 1/29/2008 10:56 AM
Gravatar

Hi, I'm using Instrumentation of Enterprise Library in an project, I need to create news permormance counters for my project, How can I to do this?
If you have an example, please give me your code. Thanks you

# re: Enterprise Library - Instrumentation

Left by ravi at 8/15/2008 8:25 AM
Gravatar

good to know all these things

keep it up

Cheers

Comments have been closed on this topic.