So you need performance data on windows and you need it quickly. A pragmatic solution is daunting, you can read some registry keys and parse through the block of data it provides, there is the Performance Data Helper API, the WinSNMP library, or there is a COM interface through WPI.
If only the task monitor application could cut a log file.... Update: for what it is worth, perfmon can cut log files, it just isn't immediately obvious how to accomplish this.Typeperf to the rescue
There is a way to get performance statistics without having to code your own monitor (and without relying on SNMP - it seems silly to use SNMP to gather performance statistics on a local machine). Typeperf is in the System32 directory. It is a wrapper for the PDH API. You need only locate the appropriate PDH description for the counter you want to monitor. Typeperf can do remote monitoring also.
For a complete list of the performance monitoring objects (PerfObjects) run:
typeperf -q
Warning: the list will be very long. If you want to see only the counters related to a specific PerfObject you can run:
typeperf -q <object name>
Valid objects to query include:
Processor System PhysicalDisk LogicalDisk Server Memory Cache Objects Paging File Thread Job Object Job Object Details Terminal Services Session ICMP TCP UDP IP Network Interface NBT Connection Telephony Print Queue RSVP Interfaces RSVP Service RAS Total RAS Port PSched Flow PSched Pipe .NET CLR Data ASP.NET Distributed Transaction Coordinator Server Work Queues Redirector Browser WMI ObjectsMost of the objects listed above provide multiple counters. Some of the objects will have multiple instances - allowing you can query the counters for individual instances. Basically, you can monitor every aspect of a Windows XP system from the command line, or from the command line of a remote computer. This is power. No *NIX system I've seen has the ability to do this (correct me if I'm wrong).
