Since you mentioned "our services" so I'm assuming you have an idea of
which processes you want to log. If you have an idea of which
processes are problematic you can log CPU usage for selected process
names (don't have to tie it to a specific PID). You can use Windows'
perfmon.exe (Start Menu -> Run... -> perfmon). Although it is a
monitoring tool you can log the data to a file.
To use it, start up perfmon.exe. Expand the "Performance Logs and
Alerts" tree. Select "Counter Logs". Right click on the main window
and select "New Log Settings..." Type in a name. Select "Add
Counters..." Under "Performance object" select "Process". Use the
default "% Processor Time" counter. Now either select the suspected
instances or select "All instances". Note that selecting all
instances only selects the processes running at that time, new
processes will not be added when started. It will however handle the
case when a process stops and then starts again with a new PID.
Select "Add" to add this counter and then select "Close". Now set
your Interval to whatever you want. Note that the smallest Interval
you can use with perfmon is 1 second. You can download the Windows
2000 Resource Kit if you want to get perfmon4.exe which can gather
statistics at 1000 times a second. Now select the "Log Files" tab and
select your log file type, you may want to save it to a Text (comma
separated or tab separated) file if you want to be able to view the
logs in a normal viewer. Select "Configure..." if you want to
change the log file name and location. Now select "Apply" and "OK".
Select your log and use either the right click menu or the toolbar to
start. This will continue to gather statistics until you tell it to
stop.
This entry was posted
on Friday, October 10th, 2008 at 8:03 am and is filed under Windows.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.