performance counters

just write whatever you want

performance counters

Postby ciuly » Thu Nov 29, 2007 10:57 pm

Hi madshi,

found your piece of code for cpu utilization here http://www.experts-exchange.com/Program ... 27047.html
where did you get the object number (238) and counter number (6)? I can't seem to be able to find anything on the net (obviously it's pretty hard not knowing what to search for)
I'm trying to get some more info, for memory and network card so I need a list of object and counter numbers and their coresponent names. I did find this on msdn, but no connection to the actual numbers.
Aloo, as I saw somwhere, these numbers are not the same for different win versions. What would be a more correct way fo getting this info? the object and counter name would be a good choice but then again, that's just how I see it.
All I want is a little push in the right direction. it seems I'm just not searching right since i can't find anything realy usefull.

thanks.
ciuly
 
Posts: 62
Joined: Mon Apr 30, 2007 1:16 pm
Location: Romania

Postby madshi » Sat Dec 01, 2007 10:34 am

Unfortunately this is SO long ago, I don't remember any dirty details... :?

Maybe some of the other comments in that Experts Exchange question help? It seems there are some functions that can translate names to indexes somehow?
madshi
Site Admin
 
Posts: 9664
Joined: Sun Mar 21, 2004 5:25 pm

Postby ciuly » Sat Dec 01, 2007 9:45 pm

well, no problem. that's a starting point. I'll look into that. thanks ;)
ciuly
 
Posts: 62
Joined: Mon Apr 30, 2007 1:16 pm
Location: Romania

Postby ciuly » Sun Dec 02, 2007 3:50 pm

found it here
I've implemented a helper unit/function to access performance counters by object and counter name.

thanks for the tip :)
ciuly
 
Posts: 62
Joined: Mon Apr 30, 2007 1:16 pm
Location: Romania

Postby madshi » Sun Dec 02, 2007 4:52 pm

So are the numbers/names really different in different OSs?
madshi
Site Admin
 
Posts: 9664
Joined: Sun Mar 21, 2004 5:25 pm

Postby ciuly » Sun Dec 02, 2007 5:32 pm

dunno :)
this is the article that I read mentioning the differences.

all I did was: get all index-name pairs once at project startup and cache them in a stringlist as "name=index" so I can use cache.values[name] to get the index.
that will work on all systems but not with my current code to get the value since I am using your code where I get the object first and then iterate through the counters. I'll have to document a little on a way to get the counter dirrectly, if that is at all possible.
so if the guy is right, this won't work on all systems. I don't have a way to test it so this will probably be tested by my client :)
ciuly
 
Posts: 62
Joined: Mon Apr 30, 2007 1:16 pm
Location: Romania


Return to fun talk

Who is online

Users browsing this forum: No registered users and 1 guest