Jay Roy
asked on
profiler for performance measurement- java multithreading
hi guys
I am using executor service in my code. Is there a profiler i can use to check what the threads are doing and how much time it takes to finish the task.
Right now i am using System.currentTimeMillis() to calculate the time taken but its inaccurate
long exportStartTime= System.currentTimeMillis() ;
ExecutorService executor = Executors.newFixedThreadPo ol(3);
final HSSFWorkbook runnableWb = wb;
Runnable expTask = new Runnable(){
public void run(){
getExportDocumentObject(tr ue, "Excel",buffer, mReq,runnableWb);
}
long exportEndTime= System.currentTimeMillis() ;
System.out.println("Time taken for task (VERY INACCURATE):" + exportEndTime-exportStartT ime);
Are there any open source profilers which can tell me which thread is doing what and how much time it takes complete the task?
thanks
I am using executor service in my code. Is there a profiler i can use to check what the threads are doing and how much time it takes to finish the task.
Right now i am using System.currentTimeMillis()
long exportStartTime= System.currentTimeMillis()
ExecutorService executor = Executors.newFixedThreadPo
final HSSFWorkbook runnableWb = wb;
Runnable expTask = new Runnable(){
public void run(){
getExportDocumentObject(tr
}
long exportEndTime= System.currentTimeMillis()
System.out.println("Time taken for task (VERY INACCURATE):" + exportEndTime-exportStartT
Are there any open source profilers which can tell me which thread is doing what and how much time it takes complete the task?
thanks
ASKER
I use eclipse, not sure I want to move to netbeans. Are there a which any commercial ones which are good?
Thx.
Thx.
Jprofiler
ASKER
Does jprofiler give thread by thread information? Like which thread is doing what?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
heard lot of good things about Yourkit. Downloaded the trial. Fantastic tool.
There is another profiler TPTP which can be plugged into Eclipse. - Did not try this yet
I beleieve JDK 6 or 7 comes with some profilers by default.
I once saw profiling thru NetBeans at a Java conference . I suggest you try it first