EntLib 4.1 Instrumentation

Topics: Enterprise Library Core, Policy Injection Application Block
Dec 13, 2009 at 10:22 PM

I cannot add counters to the Performance Monitor.

I've ran the "Install Instrumention" batch.

I've created my category (Is this usefull for the moment ?) with : "C:\Windows\Microsoft.NET\Framework\v2.0.50727\installutil.exe" /category=Toto "C:\Program Files (x86)\Microsoft Enterprise Library 4.1 - October 2008\Bin\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.CallHandlers.dll"

I've added the <instrumentationConfiguration performanceCountersEnabled="true" eventLoggingEnabled="true" />

I've added the Performance Counter Handler to my Policy with CategoryName=Toto. My policy works fine with the other handlers. But what does mean InstanceName ?

From the Performance Monitor I can add counters from Toto as Enterprise Library Counters and the like, but when I say OK there is no counters visible in the Performance Monitor ! In fact when I add counters, <All instances> and <No instances> are greyed out.

I just want first to monitor Validation Counters and Exception Counters from my code running as Unit Tests. But I don't understand how to achieve this. Any idea ? I have not found a lot of documentation...



Dec 14, 2009 at 8:22 AM


For the instance name, please refer to the documentation http://msdn.microsoft.com/en-us/library/cc309463.aspx . Do you mean that the ent lib counters are not visible in the perfmon?

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.

Dec 17, 2009 at 2:49 PM
Edited Dec 17, 2009 at 2:50 PM

Counters are only visibles from the "add counters" box and I can add them, but it does nothing, they do not appear then in the perfmon, no graph, no counters.

Yes I've seen this doc but it says for example "Select the InstanceName property, and then enter the name of the performance counters instance you created when installing the counters into the operating system." But I have not installed any instance, only a category ?? My InstanceName is set to {appdomain}.

Is there somewhere a lab or full sample with PIAB invoking a Performance Counters Handler ?? It can help me...


Dec 17, 2009 at 7:46 PM

Hi All,

I am having similar issues with Instrumentation in the 5.0 drops as I attempt to migrate EL5 to .NET4 (see Composure).

It seems like it would be useful to add to the Enterprise Library suite a GUI utility specifically designed to handle EL WMI configuration. It is really a tedious process to ensure that all counters, configuration settings, and events, are properly set up for the tests and the QuickStarts. I think it has to be one of the primary issues when developers decide to give up on EL because of the relative complexity involved. I think a lot of people must throw up their hands before they even make it through the "Quick"-Starts, much less the full suite of tests.

I have not had any success with the script provided. Instead I have had to individually work directly with InstallUtil.exe and then check WMI repeatedly to resolve problems. I don't know if this has anything to do with using the newer operating systems (server 2008 r2, vista, win7) or what.

Am I missing something or does anyone know of an existing utility that makes this process easier and faster to manage?

It also seems like a good idea to dedicate a specific document with more detailed guidance for instrumentation and configuration required to run all tests successfully. I've encountered significant numbers of tests that fail invariably because of the assumptions made by the tests themselves and NOT because there's anything wrong with the library itself. Obviously the P&P team has all of this configured properly on an ongoing basis. But those of us who migrate across development environments are subject to a severe penalty when it comes to such issues.