Examples of usage for win32pdh.ExpandCounterPath()?
MHammond at skippinet.com.au
Sat Jun 19 02:28:27 CEST 1999
calouro wrote in message <376ac08a.13773775 at news.worldtalk.com>...
>The win32 extensions work well once I figure out how to call them
>correctly -- which is much easier if I have some examples to study and
The help files and looking at win32pdhutil contain the hints you need. The
biggest problem with win32pdh is knowing what counters to use, and their
OK - lets browse for the counters. In the dialog that is presented, we
select a counter, and press "Add":
>>> import win32pdhutil
Browsing for counters...
Value of '\\BOBCAT\Process(_Total)\% Processor Time' is 95.5669019211
Added '% Processor Time' on object 'Process
OK - now we know the format of at least one counter. The documentation to
ExpandCounterPath implies you can add wildcards. So, lets try it:
>>> import win32pdh
>>> from pprint import pprint
['\\\\bobcat\\Process/_Total)\\% Processor Time',
'\\\\bobcat\\Process/_Total)\\% User Time',
'\\\\bobcat\\Process/_Total)\\% Privileged Time',
'\\\\bobcat\\Process/_Total)\\Virtual Bytes Peak',
More information about the Python-list