in reply to WinNT CPU & MEM usage
I'd probably start with Win32::PerfLib, though I know little about it.
- tye (but my friends call me "Tye")
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (tye)Re: WinNT CPU & MEM usage
by Trinary (Pilgrim) on Jan 09, 2001 at 13:49 UTC | |
<quote>What is in the box? The PerfLib structures that are returned are huge, 7 hash refs deep (and not all info is at the same level, depending on vague criteria), obfuscated, horrendously documented, and generally an agonizing process to get to. To get nearly all (but, of course, not consistently all) information back you need to store (at least) 2 calls to each monitoring object and perform a type-specific calculation that is different for each one, using information that can be in some 4 of the 7 hash levels. This is the beast I've been trying to tame for a month or two now, and I'm just now getting to the point where I'm getting useful info back...granted, I had to wrangle a couple other issues (running as a service correctly, etc) but trust me, other things in AdminMisc are far better suited to simple CPU/Mem monitoring, but to get stuff like SQL Server, IIS, and Exchange server usage stats you have to go through PerfLib. Read this as well as the calculation section, and pity me. =) Those are the docs I have to go on...if anyone has any pointers to better description of how to get stuff out of PerfLib, I'd love to see em. Kind of a rant I guess, but I don't want anyone to waste their time and sanity on this when they don't have to. Posted another rant before, but it got snarfed, probably a browser thing. Later all Trinary | [reply] |
by myocom (Deacon) on Jan 09, 2001 at 23:29 UTC | |
For what it's worth, here's an example script for Win32::Perflib that Dave Roth wrote. It could easily be changed to include CPU usage.
| [reply] [d/l] |
by tye (Sage) on Jan 09, 2001 at 21:12 UTC | |
Thanks for the warning. Just an FYI, the insanity I see in the documentation pretty much matches the insanity that is Win32 performance counters. It certainly seems that a few helper functions are in order for the more common cases. You can also get at this information in its raw form via Win32API::Registry if you'd like to compare the madnesses. :-} I see nothing in Win32::AdminMisc that gives CPU usage statistics, BTW. - tye (but my friends call me "Tye") | [reply] |