Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

profiler for performance measurement- java multithreading

Posted on 2012-03-14
6
Medium Priority
?
284 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
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

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 1200 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

824 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