Chris's profileChris Burrows' Live Spac...PhotosBlogListsMore ![]() | Help |
|
September 08 The simplest possible way to add performance counters to your application using Enterprise Library January 2006After spending a couple of days looking at how the instrumentation works in the Enterprise Library and finding out how lacking the documentation is around instrumentation I thought I would share my experiences with you. The best I dive into solution mode I thought I would describe what the enterprise library provides on top of the out of the box performance counters. The biggest thing it does is abstract away the creation and management of the performance counter. Instead of writing code you can just use a few of attributes, use the EnterpriseLibraryPerformanceCounter class, create an installer and away you go. It is that simple. Rather than leave it at that, let me walk you through the exact steps that you need to follow. Step 1. Create a Class to House the Performance Counters The first thing that you need to do create a class that will hold the performance counters, and do the work of updating them when required. For example:
Step 2. Create an Project Installer The next step is to create a project installer, this is really really simple. Just create a class that looks like the following.
Step 3. Use the Performance Counter Class All the hard work is done, you can now start to use the performance counters. For example
Step 4. Install the Performance Counters The final setp is to install the performance counters. This is done simply by running install util over the assembly that contains the project installer. This is as simple as and looking for "The Commit Phase Completed Successfully" > intallutil simplestpossibleperformancecounter.exe You're done. To see the output of all your hard work fire up performance monitor, add in the your counter to the output and away you go!
In my next post I'll describe how instrumentation implement instrumentation, in the same way as the Application blocks in the Enterprise Library do. TrackbacksThe trackback URL for this entry is: http://madtechnology.spaces.live.com/blog/cns!F637E4FD356E127D!121.trak Weblogs that reference this entry
|
|
|