Hi Monks,
First, I am using a Redhat box with the latest version of Apache. I need to get the cpu usage at the end of each http request, and store it for the VirtualHost that requested it. I have no problem getting cpu usage from /proc/$pid/stat... the problem is timing. I need to record the cpu usage before another request comes in to the same apache process, so I am using an apache handler to put the process "on hold" until I can get the cpu usage. The problem is that stat does not get updated with the latest stats until after the apache process has completed the current request. I'm hoping there is some way to get the stat to update while the apache process is still running... I hope I've explained myself well ... any suggestions?