Performance Counters

Topics: Caching Application Block
Jan 9, 2009 at 6:06 PM

I have couple questions related to the performance counters

1. How to deploy them in a fresh enviroment? I tried using the batch file and it didn't work. What I did was, copied all assemblies related to the caching application block to the box and ran the batch file having installUtils command. It didn't throw eny error, however, when I went to PerMon to configure the counter for log I can't see the Enterprise Library Caching Counter performance object in the drop down. I can see data access one. Please let me know if I am missing anything

2. On my development box, I can see performance object, so I configured the counters for logs so that when the application is running, it logs the performance data, however if I stop the application and start it again, it does not log the performance data. I have to go to the configuration of performance log again, remove the counters and add them back when the application is running and then it starts logging the data again. Anyone knows why is this happening? How to overcome this? Its important that I configure it once so that it would work all time without doing it again and again.

Any input would be highly appreciated...


Jan 12, 2009 at 10:47 AM
Edited Jan 12, 2009 at 10:51 AM

How did you run the batch file? Did u just simply double-click it? Try Executing the, All Programs > Microsoft Patterns and Practices > Enterprise Library > Install Instrumentation

Please see this:

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
Jan 27, 2009 at 6:49 PM
Hi Valiant,

The installation worked for me now, however when I am using it for logging the performance counters, I have to add the counter every time I start the application.

I want to collect sample for my process, so I have configured performance counter log. To configure it, I started the application and added the counters for my process to the counter logs. It works this time, however, if I stop my process and restart it again and restart the counters, the performance coutners related to caching block doesn't collect data so the log file has empty data for caching performance counter, however, other counters such as Process private bytes and other standard performance couters are logging data between process restarts.

Can you please tell me what could be wron? Why do I have to add the counters back when I restart my process?

Jan 28, 2009 at 8:26 AM

I'm trying to reproduce your scenario, but i cant, please check my steps if it does reproduce your scenario.

I have a sample app(The CachingQuickStart solution). I Installed the Instrumentation, the one that i've metioned before. I Also enabled the sample app for Instrumentation.

1. I open the performance monitor and add the caching counters. (Success)
2. Run the Application, Do some stuff to caching and the counter works(increments).
3. Restart my app and do step #2, it works again.
4. Configure a Counter Log and associate it with the Ent lib Caching performance counter.
5. Do steps # 2 and 3, and looked at the log, and it continue to log even after application restart.

Is this steps reproducing your scenario? 

Valiant Dudan
Global Technology and Solutions
Avanade, Inc.
Jan 28, 2009 at 2:04 PM

Thank you for your reply.

Interestingly, when I tried to reproduce my scenario on windows form application (Quickstart sample), it works across application restarts, however, I have a windows service and when I tried to get this work on that it does not work.

I am following same steps...

start service,
add counter log in comma delimted sampling at every 5 seconds
observe results logged in the log file
stop service
stop counter log
start counter log again
start service
do some caching functionality in service
stop service
stop counter log
observe results