Performance Data He...
 
Notifications
Clear all

We appreciate the contributions many of you have been able to make towards repairing the storm damage and keeping a roof over our heads. With your help we’ve been able to complete much of the critical work. There is still work to be done to secure the house and your continued support will be a huge help.

Guests have read-only access to our forums. If you wish to participate you will need to register. Be sure to activate your account from the email sent to you when you register.

[Closed] Performance Data Helper (PDH)

1 Posts
1 Users
0 Reactions
2,160 Views
Glenn
(@glenn)
Member Admin
Joined: 8 years ago
Posts: 1903
Topic starter  

Because I'm having real issues with WMI performance and regular lockups, and I presume others are as well,
I've starting implementing PDH (PerfLib) code to retrieve performance counters. In every case where
performance data is collected, PDH will be the default with WMI as the fallback. The exception to this is
the CPUUSAGE item which has been using PDH for a long time and seems ok.

What is PDH?
Windows Performance Data Helper (PDH) API allows developers to programmatically access performance
metrics and performance counters in a Windows system. It can be used as an alternative to WMI queries
for retrieving performance metrics.

The advantages are: it is, on average, 20-30 times faster than WMI, it is much easier to code and it
doesn't seem to suffer from the flakiness that I'm seeing in WMI.

However, it does have it's own unique set of challenges, for the most part centered around language. I'm
writing it to be as flexible as possible. You can specify the wildcard path in English or your local
language. You can specify whether to supply the output counter names in English or your local language. If PDH
can't find the counters or some other issue prevents it from working, DTI will fall back to WMI where
possible.

The easiest way to see your system performance counters is with Windows perfmon. When
you add counters you're presented with a list of objects, instances and counters. These are
the counters that Desktop Info will retrieve via the PDH API.


   
Glenn's Page