(This does not apply to the main programming questions that I usually ask!)
We have an interesting question. We have a multi-threaded non-visual server application (which starts 10-20 workflows for each process), and it uses a ton of processor. This is by design.
We cannot profile the workload of the real world of this code in the development system. The load is very high (very high). To optimize this code, we must be able to keep a log for production bits, which work tasks take up so much CPU.
In our current implementation, the System.Diagnostics.ProcessThread.TotalProcessorTime parameter is used for measurement, but in .NET v4 it does not guarantee the proximity of the .NET logical stream to ProcessThread, so we cannot be sure what exactly we are measuring.
What can we do to measure the CPU usage of each thread / each function?
We heard that an alternative lib for streaming is one way, any suggestions?
source share