This content has been marked as final. Show 5 replies
Addition: I tried using the standard method of computing system load by using the sum of the ratio between execution times and periods, but jitter in my execution times cause this calculation (which I perform using average execution time for each thread) to differ from actual system load.
Neither the RTSJ nor Java RTS provide any information of this kind. Honestly I'm not sure what information could be provided.
There exist management beans in the Java platform which can report Thread CPU time used, but even if that is supported, I don't think there is any way to correlate that to elapsed time to get an indication of load.
You could probably gather this information using DTrace - by tracking the on/off-cpu transitions of each thread - but I couldn't tell you in detail how to do that.
If you're running Java RTS on Solaris, DTrace is able to provide you all the details about the time each thread is running on each processor. You could also download the tool called Thread Scheduling Visualizer (TSV) on Java RTS download page. This tool is using DTrace to record this kind of information and provides a graphical view of the scheduling of the different threads. The TSV bundle also contains a directory called DTraceToolBox with several DTrace scripts. The script named thread_cpu_prio.sh should do something close to what you're looking for.
Thanks, I checked out the ThreadMXBean after this post. Some of its methods can help me with what I want.
I am currently on an RT Linux platform. I tried looking for ports of DTrace for Linux and checked out some of the Linux alternatives, such as SystemTap, but none of them appear to offer the range of functionality and ease of use of DTrace. I will be switching to OpenSolaris to give it a try. Thanks for the response.