Solved

profiler for performance measurement- java multithreading

Posted on 2012-03-14
6
257 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about the different types of variables in Java and how to declare them. Decide the type of variable desired: Put the keyword corresponding to the type of variable in front of the variable name: Use the equal sign to assign a v…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

743 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

12 Experts available now in Live!

Get 1:1 Help Now