Tx icon indicating copy to clipboard operation
Tx copied to clipboard

Example for realtime sampling of "\\Processor(*)\\% processor time"?

Open jjYBdx4IL opened this issue 3 years ago • 2 comments

Can you please give an example on how to do this?

 string[] arr = new string[1];
 arr[0] = "\\Processor(*)\\% processor time";
 PerfCounterRealTimeProbe pcrtp = new PerfCounterRealTimeProbe(this, TimeSpan.FromSeconds(1), arr);

However, that causes a PDH_CSTATUS_NO_OBJECT exception.

jjYBdx4IL avatar Feb 15 '22 17:02 jjYBdx4IL

your code looks good. Maybe the issue is lowercase letters in "processor time" Tx does not do any interpretation of the strings - it just passes them to the native APIs

georgis avatar Feb 15 '22 21:02 georgis

I copied that string from a working C/C++ PDH example. To me it seems Tx.Windows does a lot more than is actually necessary and that's where that is coming from.

jjYBdx4IL avatar Feb 15 '22 22:02 jjYBdx4IL