Solved

profiler for performance measurement- java multithreading

Posted on 2012-03-14
6
266 Views
Last Modified: 2012-03-24
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.newFixedThreadPool(3);                        
 final HSSFWorkbook runnableWb = wb;
 Runnable expTask = new Runnable(){        
 public void run(){        
 getExportDocumentObject(true, "Excel",buffer, mReq,runnableWb);
 }
long exportEndTime= System.currentTimeMillis();                  
System.out.println("Time taken for task (VERY INACCURATE):" + exportEndTime-exportStartTime);


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
0
Comment
Question by:royjayd
  • 3
  • 3
6 Comments
 
LVL 12

Expert Comment

by:Sharon Seth
ID: 37723629
Netbeans has got some very good profilers which work very well on profiling threads .

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
0
 

Author Comment

by:royjayd
ID: 37724457
I use eclipse, not sure I want to move to netbeans. Are there a which any commercial ones which are good?

Thx.
0
 
LVL 12

Expert Comment

by:Sharon Seth
ID: 37724486
Jprofiler
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:royjayd
ID: 37724954
Does jprofiler give thread by thread information? Like which thread is doing what?
0
 
LVL 12

Accepted Solution

by:
Sharon Seth earned 300 total points
ID: 37725142
Ofcourse , it does  . It's commercial , has much more features
0
 

Author Comment

by:royjayd
ID: 37732830
heard lot of good things about Yourkit. Downloaded the trial. Fantastic tool.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now