Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JBIDE-18372 - tweaking progress monitors #307

Merged
merged 1 commit into from Dec 4, 2014

Conversation

@robstryker
Copy link
Member

robstryker commented Nov 24, 2014

No description provided.


boolean isBinaryObject = ServerModelUtilities.isBinaryModule(module);
File[] toTransfer = null;
if( !isBinaryObject ) {
File file = zipLocally(module[0], publishType, ProgressMonitorUtil.submon(monitor, 100));
monitor.setTaskName("Zipping module: " + module[0].getName()); //$NON-NLS-1$
File file = zipLocally(module[0], publishType, new NullProgressMonitor());

This comment has been minimized.

Copy link
@robstryker

robstryker Dec 3, 2014

Author Member

Somehow missing the change here. Should not be using null progress monitor. Wtf.

@robstryker robstryker force-pushed the robstryker:JBIDE-18372 branch 2 times, most recently from e0911b0 to 4fd0b86 Dec 3, 2014
@@ -308,10 +317,13 @@ private String getDeploymentOutputName(IServer server, IModule module) throws Co
public void publishServer(int kind, IProgressMonitor monitor)
throws CoreException {
// intentionally blank
monitor.beginTask("", 100); //$NON-NLS-1$

This comment has been minimized.

Copy link
@maxandersen

maxandersen Dec 4, 2014

Member

what is the point of this begin and then mark as done immediately ?

This comment has been minimized.

Copy link
@robstryker

robstryker Dec 4, 2014

Author Member

So I tested it a lot with and without these parts. Theoretically, I should have similar lines for publishStart and publishFinish. WTP is allocating sub monitors for these methods, and never marks them as done. It's my job to start, and then done() them.

The problem is if I have the monitors in publishStart and publishFinish and publishServer, then the actual publish (zip plus transfer) is really only like 40% of the monitor (depending on the number of modules being published, but for 1 module being published, it's 40%). Basically, their weights are kinda... weird.

So I decided to keep the start() and done() in only publishServer, not publishStart / publishFinish (for THIS publish method). It makes it so the progress monitor advances to about 15%, and when the publish is basically complete, the monitor is at around 78%.

If I were to put it into all three of them, then the progress monitor would read like 40% before I even did anything, and around 80% afterwards.

At this point it's kind of a value judgement and what I feel works best for the user... to see some progress in the beginning, then the slow increase during zip and mgmt calls, and then a fast end.

Tested with an example project with 5000 files in it.

@maxandersen
Copy link
Member

maxandersen commented Dec 4, 2014

+1 looks simple enough.

just wondering what the noop begintask/done is for.

@robstryker robstryker force-pushed the robstryker:JBIDE-18372 branch from 4fd0b86 to dba94d3 Dec 4, 2014
@robstryker robstryker merged commit dba94d3 into jbosstools:master Dec 4, 2014
@robstryker robstryker deleted the robstryker:JBIDE-18372 branch Jan 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.