This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 57639 - Add option to "Analyze Performance" that does not include time spent in Thread.sleep() and Object.wait () in the method Self time
Summary: Add option to "Analyze Performance" that does not include time spent in Threa...
Status: CLOSED FIXED
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 4.x
Hardware: PC Linux
: P2 blocker (vote)
Assignee: iformanek
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-04-07 19:12 UTC by josephcz
Modified: 2007-02-12 22:07 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description josephcz 2005-04-07 19:12:08 UTC
In Milestone 5:

When analyzing the performance of a threadded application where a thread spends
most of its time in java.lang.Thread.sleep(..), the method that make the call to
Thread.sleep(..) has a "Self time" of 99.9%. This makes all graphs and
percent-time values useless. (Below is a simple example Test.java.)

I would like to have a checkbox option added that would exclude any time spent
in Thread.sleep(..) from the charts and the call graph.


==== FILE Test.java ====
public class Test implements Runnable {
  private static final int MAX_COUNT = 1000;

  private String name;
  private long   delay;

  public Test(String name, long delay) {
    this.name  = name;
    this.delay = delay;
  }

  public void run() {
    for(int i = 0; i < MAX_COUNT; i++) {
      System.out.println(name + ": i = " + i);

      try {
        Thread.sleep(delay);
      } catch(InterruptedException e) {
        e.printStackTrace();
      }
    }
  }

  public static void main(String[] args) throws Exception {
    Thread.sleep(10000); // Wait while I attach profiler

    Test testA = new Test("testA", 2000);
    Test testB = new Test("testB", 1500);

    (new Thread(testA)).start();
    (new Thread(testB)).start();
  }
}
Comment 1 iformanek 2005-04-12 13:38:54 UTC
I second this - most profilers do have this option, and it seems that it most 
closely reflects what one would want to see when doing CPU profiling - and this 
should be the default behavior.

We'll try to look at this for the first release, although I cannot promise this 
will be addressed.

BTW. the CPU timer (as opposed to the Absolute one) does not include the sleep 
() method in the results, and may address part of this already.
Comment 2 iformanek 2005-06-03 13:30:44 UTC
This will not make it into 1.0
Changing to feature
Comment 3 iformanek 2005-08-02 12:54:12 UTC
Updated the summary to more correctly describe the issue.
Comment 4 iformanek 2005-09-06 15:01:19 UTC
Replanning back to 1.0 release, will be in upcoming M9 release.
Comment 5 iformanek 2005-09-16 12:10:18 UTC
Done in M9
Comment 6 ehucka 2006-10-09 12:10:07 UTC
Verification of old issues.
Comment 7 Alexander Kouznetsov 2007-02-12 22:07:56 UTC
Closing old issues.