Performance Monitoring using WMI



Hi All,

We are trying to build performance counters using WMI to publish
custom performance data from our .NET web service and we want this
performance data to persist after System reboots or System crashes. So
far we have explored and come up with following approaches:

1) Building WMI static classes which store the data in WMI repository.
(Note: Easy to implement and use, but it seems that storing
transactional data in WMI static repository is not recommended.)
2) Building WMI classes using COM Instance providers which store the
performance data in the local system resources such as Flat files,
Registry or Database.
(Note: More difficult to implement compared to previous approach,
as COM provider has to be written in C++. But this is the approach
which is generally recommended.)

However I am not able to decide which of these is better or if there
is any other approach. We even explored using system.diagnostics as an
alternative but had to reject it as it uses registry to store the
counter values.

Could any one suggest what the best practice for the above scenario

Thanks in advance

Philip Nunn [MSFT]

A solution following the model of 2) below but using .NET implementation
would be to publish counters using the .NET PerformanceCounter class (see
Published counters will be available to clients through both WMI and the
Performance Counter .NET class. Clients (apps, scripts, etc.) can sample
the counters at an interval of their choosing and store them as they see


Hi Philip,

Thanks for your response. You are perfectly right in suggesting this
but actually here we would like to use WMI only not the performance
counters that needs registry access and all..
We have to use WMI classes only as our prime requirement. Can you
suggest some thing in that direction.


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question