#Processes/CPU Usage/Memory Usage

#Processes/CPU Usage/Memory Usage

Post by Michael Scot » Fri, 28 May 1999 04:00:00



I'm trying to locate API's that will let me duplicate those fields you
see at the bottom of the Task Manager for the CPU Usage, Memory Usage,
and the # of Processes, but haven't had much luck yet.

I need to duplicate those, then determine how much of that usage belongs
to a suite of apps (CPU/Mem), and how many of those processes belong to
the same.

So far, I haven't had much luck in the VC5 help, or MSDN.  Obviously,
I'm missing something basic, and am barking up the wrong tree.  Anyone
have some suggestions as to where I should be looking?

Michael

 
 
 

#Processes/CPU Usage/Memory Usage

Post by Michael Scot » Fri, 28 May 1999 04:00:00


BTW, does anyone have a copy of NTDLL.H they could send me?

Michael


> I'm trying to locate API's that will let me duplicate those fields you
> see at the bottom of the Task Manager for the CPU Usage, Memory Usage,
> and the # of Processes, but haven't had much luck yet.

> I need to duplicate those, then determine how much of that usage belongs
> to a suite of apps (CPU/Mem), and how many of those processes belong to
> the same.

> So far, I haven't had much luck in the VC5 help, or MSDN.  Obviously,
> I'm missing something basic, and am barking up the wrong tree.  Anyone
> have some suggestions as to where I should be looking?

> Michael


 
 
 

#Processes/CPU Usage/Memory Usage

Post by Ariel Lope » Fri, 28 May 1999 04:00:00



Quote:> I'm trying to locate API's that will let me duplicate those fields you
> see at the bottom of the Task Manager for the CPU Usage, Memory Usage,
> and the # of Processes, but haven't had much luck yet.

> I need to duplicate those, then determine how much of that usage belongs
> to a suite of apps (CPU/Mem), and how many of those processes belong to
> the same.

> So far, I haven't had much luck in the VC5 help, or MSDN.  Obviously,
> I'm missing something basic, and am barking up the wrong tree.  Anyone
> have some suggestions as to where I should be looking?

> Michael

OK: For Get these values you must use the registry there are two ways

1- By mean of pdh library
    in these you find functions for access and counters for the object (the
object are the processor, the process, the memory , etc. The counter are
properties of  the objects like %usage cpu etc and varies from object in
object because its nature ) you find docs of how using in the msdn library
in platform sdk in process data helper section

2- the same information you can get accessing directly the registry using
the function regquerybyex, etc; too the  docs in the library (next section
that follow  pdh section)

Good Luck

p/d
I am using the option 2- (i am using gcc compiler) but i wish to somebody
tell me why the values of the counter % processor use of the object process
and too with the threads give values too small (by example all  % processor
use of every process added result in values small like 0.007%) i am using nt
4.0 (i dont know if i needed the service pack 3 o later)the others counters
apparently give me ok's values

 
 
 

#Processes/CPU Usage/Memory Usage

Post by Richard Holli » Tue, 08 Jun 1999 04:00:00


Michael,

I take it you have found the HKEY_PERFORMANCE_DATA key already?

If not then look this up on MSDN, go from there. It's a good starting point.

There are examples on MSDN, which will show you how to get performance data
and from this you could count the number of processes running on a machine.

Search on Dejanews, there have been similar postings about this topic in
this group quite recently.

Regards,
Richard.

 
 
 

#Processes/CPU Usage/Memory Usage

Post by Fred Jackso » Tue, 08 Jun 1999 04:00:00


Do you have a million bux?  If so you might try giving Microsoft
corporate headquarters a call :-)


Quote:> BTW, does anyone have a copy of NTDLL.H they could send me?