<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2802" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=348013422-26042006><FONT face=Arial color=#0000ff size=2>Please
see the comments in win32pdhutil.GetPerformanceAttributes - they explain that
many attributes, particularly the processor ones, require 2 samples to give
reasonable results.</FONT></SPAN></DIV>
<DIV><SPAN class=348013422-26042006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=348013422-26042006><FONT face=Arial color=#0000ff size=2>The
comment says:</FONT></SPAN></DIV>
<DIV><SPAN class=348013422-26042006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=348013422-26042006><FONT face=Arial color=#0000ff
size=2> # NOTE: Many counters require 2 samples to give accurate
results,<BR> # including "% Processor Time" (as by definition, at any
instant, a<BR> # thread's CPU usage is either 0 or 100). To read
counters like this,<BR> # you should copy this function, but keep the
counter open, and call<BR> # CollectQueryData() each time you need to
know.<BR> # See <A
href="http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262938">http://support.microsoft.com/default.aspx?scid=kb;EN-US;q262938</A><BR> #
and <A
href="http://msdn.microsoft.com/library/en-us/dnperfmo/html/perfmonpt2.asp">http://msdn.microsoft.com/library/en-us/dnperfmo/html/perfmonpt2.asp</A><BR> #
My older explanation for this was that the "AddCounter" process
forced<BR> # the CPU to 100%, but the above makes more sense
:)<BR></FONT></SPAN></DIV>
<DIV><SPAN class=348013422-26042006><FONT face=Arial color=#0000ff
size=2>Cheers,</FONT></SPAN></DIV>
<DIV><SPAN class=348013422-26042006><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=348013422-26042006><FONT face=Arial color=#0000ff
size=2>Mark</DIV></FONT></SPAN>
<BLOCKQUOTE
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid">
<DIV class=OutlookMessageHeader dir=ltr align=left><FONT face=Tahoma
size=2>-----Original Message-----<BR><B>From:</B>
python-win32-bounces@python.org [mailto:python-win32-bounces@python.org]<B>On
Behalf Of </B>Tino Dai<BR><B>Sent:</B> Thursday, 27 April 2006 8:25
AM<BR><B>To:</B> Python-win32@python.org<BR><B>Subject:</B> [python-win32]
Simple questions
aboutwin32pdhutil.GetPerformanceAttributes<BR><BR></FONT></DIV>Hi
there,<BR><BR> Is there a list of performance
stats that one can get back from GetPerformanceAttribute. In the Python
Programming in Win32, there is an example with Memory and Available bytes, but
none of the processor stats seem to work. Thanks!
<BR><BR>-Tino<BR><BR></BLOCKQUOTE></BODY></HTML>