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 116765 - Add Profiling Points Wizard - Stopwatch Enhancement
Summary: Add Profiling Points Wizard - Stopwatch Enhancement
Status: NEW
Alias: None
Product: profiler
Classification: Unclassified
Component: Base (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker with 1 vote (vote)
Assignee: issues@profiler
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-09-26 00:50 UTC by adam_myatt
Modified: 2009-05-25 21:03 UTC (History)
0 users

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 adam_myatt 2007-09-26 00:50:06 UTC
Using NetBeans 6 Beta 1. 

When adding a Stopwatch Profiling Point, I suggest the following. In the Customize Properties screen, when you select a 
Measure type of "Timestamp and Duration", the Location (end) fields become enabled but are blank. I would say it would 
be a time saver to auto populate the Location(end) fields with the same values from the Location(start) section, 
especially the File field. You should also auto-set the Line number to END, instead of defaulting to BEGIN. You 
wouldn't really have 2 BEGIN points for a Stopwatch. You could even reasonably set the Location(end)'s LINE field to 
the same line number as the starting line number plus 1.

An even more advanced enhancement could access the underlying JAVAC API and make some assumptions. If the starting 
point line occured at the beginning of an if, else, for-loop, while-loop, etc., then the line number of the Location
(end) section could reasonably be set to the suggested line number of the closing curly brace. There could even be a 
quick shortcut on the Profile Point context menu when you right-click a line of code that begins a for-loop, if, else, 
while, and so on, that states "Add Stopwatch For Block" that automatically adds a stopwatch start and end point where 
the block begins and ends.
Comment 1 Jiri Sedlacek 2007-10-03 20:34:30 UTC
Thanks for your ideas! The first part related to populating End location will be available in NetBeans 6.0 Beta 2, the
second part is not for 6.0.

There's one thing which makes creating Stopwatches really easy - editor selection. Just select block of the code you
want to measure using Stopwatch and create the Profiling Point - both start & stop locations will be populated according
to the selection.

Based on this information - do you still think that assumptions about code blocks are really neccessary?
Comment 2 adam_myatt 2007-10-04 01:51:13 UTC
That's great about the editor selection. However, it would save several screens and multiple clicks if there was a 
submenu under the Profiling menu when you right-click. The submenu can still have an option like 'add stopwatch to 
selection' that automatically adds the start and end points for the stopwatch without any additional prompts or 
windows. 

It might also be cool if you could click the glyphs in the margin for the starting and ending points and drag them up 
or down to automatically adjust the beginning or ending point of the stopwatch.
Comment 3 Jiri Sedlacek 2007-10-04 07:45:30 UTC
What you mean by 'add stopwatch to selection' can probably be accomplished by a keyboard shortcut for creating Profiling
Points - make a selection and use Shift + F9 to select Stopwatch, then just release the keys, that's all. This should be
mentioned in some docs, now there is a lot of useful undocumented features hidden from the user.

As for dragging the glyphs - I'm afraid that NetBeans doesn't support this in any way. On the other side, have you
noticed the "Current Line" button in Profiling Point customizer? When already created Profiling Point is being
customized, the customizer dialog is not modal, you can move the cursor in the editor to the right place and pick it's
position by clicking this button.
Comment 4 adam_myatt 2007-10-04 13:07:09 UTC
Shift + F9 works great. Thanks! 

On the second part, not sure dragging glyphs is really possible. I've seen the Current Line buttons on the customize 
window. Just thought IF dragging glyphs was supported that it would be cool feature.

Thanks for answering the questions.
Comment 5 Tomas Hurka 2009-04-08 12:56:02 UTC
Milestone cleanup: future->next