Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jjYBdx4IL opened this issue Feb 15, 2022 · 2 comments
Open

Comments

@jjYBdx4IL
Copy link

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.

@georgis
Copy link
Member

georgis commented Feb 15, 2022

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

@jjYBdx4IL
Copy link
Author

jjYBdx4IL commented Feb 15, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants