Jump to content
WAPT Forum
boerni

Performance counters for system processes

Recommended Posts

Hi there,

 

I need to monitor some processes during the load test. I've tried to add a new WMI custom counter and used the method counter.WMIGetValue. When I use this method I will only receive one value. But I need the complete list of all processes. The main problem is the WQL query where I have to specify a column. Is there any way to get the complete record set so that I could use enumeration to get my data?

 

For example

var objWMIService = GetObject("winmgmts://<computername>/rootCIMV2");
var colItems = objWMIService.EcexQuery("Select * FROM Win32_PerfRawData_PerfProc_Process", "WQL");
var enumItems = new Enumarator(colItems);
for (; !enumItems.atEnd(); enumItems.moveNext()) {
var objItem = enumItem();
...
}

Any idea?

 

Thanks

Boerni

Share this post


Link to post
Share on other sites

You can get a value for specific process using following code:

counter.WMIGetValue("Select * FROM Win32_PerfRawData_PerfProc_Process where Name = 'exampleProcessName'", "exampleParamName", 0)

Share this post


Link to post
Share on other sites

Hi Sergei,

please, is somewhere any guide, that can explain how to write own performance counters?

 

Best Regards,

Jiri

 

Share this post


Link to post
Share on other sites

Hi Jiri,

There is no the such guide. You can find out some information in the WAPT help and use existing counters as examples.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...