[
https://issues.apache.org/jira/browse/MNG-5977?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15149466#comment-15149466
]
Michael Osipov commented on MNG-5977:
-------------------------------------
Salut Hervé,
I have made some progress on the issue and have produced two versions available
from: http://home.apache.org/~michaelo/MNG-5977/
1. {{apache-maven-3.4.0-MNG-5977-SNAPSHOT-bin.tar.gz}}: Nicely prints the
progress. No race conditions, no syncs where necessary. I have already cleanup
superfluous padding and {{CR}}s. All looks fine.
2. {{apache-maven-3.4.0-MNG-5977-w-filename-SNAPSHOT-bin.tar.gz}}: Extends the
previous implementation by adding the filename to the progress meter. Very nice
to see the progress. The downside is that all methods writing to
{{PrintStream}} require synchronization otherwise the race conditions will
garble the output. This can be improved by using a {{ReentrantLock}} around
{{lastLength}} and {{out}} access only. There is one glitch I do not understand
and don't know how to fix it yet. Under high concurrency, the progress is
written but not overwritten but the next progress output or an upcoming
"Downloaded:" line. The output written by {{tee}} is fine. This fails in
{{cmd}} and Git bash. This may be a race condition within the Aether threads
(unlikely hopefully) or a flaw in Windows or some important flush I forgot.
Anyway, I would appreciate if you could take a look at my patches, maybe you
will spot the issue. The second patch requires the first one first to be
applied.
In any case, I'd like to prepend the progress meter with something like "In
Progress: " or "In Transfer: ". Makes is better readable.
Tested under Windows 10 only, Linux and FreeBSD is pending.
> Improve output readability of our MavenTransferListener implementations
> -----------------------------------------------------------------------
>
> Key: MNG-5977
> URL: https://issues.apache.org/jira/browse/MNG-5977
> Project: Maven
> Issue Type: Improvement
> Components: Command Line, Embedding
> Affects Versions: 3.3.9
> Reporter: Michael Osipov
> Assignee: Michael Osipov
> Fix For: 3.4.0
>
> Attachments: current.zip, improved.zip, improved.zip
>
>
> The current output of Downloading/Downladed/Uploading/Uploaded transfer
> notification has some flaws:
> 1. It does not scale numbers between 1 and 1000 with appropriate units
> 2. It uses incorrect size and time units
> 3. When Aether downloads in parallel (which applies for non-POM files) the
> progress interleaves and you do not know to which resource a progress belongs.
> Let's use MPIR {{DependenciesRenderer}}'s
> [{{FileDecimalFormat}}|https://github.com/apache/maven-plugins/blob/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java#L1583]
> for it.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)