Tx
Tx copied to clipboard
Example for realtime sampling of "\\Processor(*)\\% processor time"?
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.
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
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.