Skip to content

feat: add progress bar to file Downloader #105

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

Open
wants to merge 2 commits into
base: ors_4.0
Choose a base branch
from
Open

Conversation

rtroilo
Copy link
Member

@rtroilo rtroilo commented Apr 24, 2025

this is an alternative version to #104

@rtroilo rtroilo force-pushed the feat-1990-2 branch 2 times, most recently from 7d661ac to eaefff6 Compare April 24, 2025 15:55
@aoles aoles requested a review from MichaelsJP April 29, 2025 09:14
@aoles aoles requested a review from Copilot May 14, 2025 14:19
Copilot

This comment was marked as resolved.

@aoles aoles requested a review from Copilot May 14, 2025 14:33
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a progress bar feature for the file Downloader by adding a new ProgressOutputStream class and updating the Downloader to use it.

  • Added ProgressOutputStream to report download progress with logging.
  • Updated Downloader to utilize the progress stream and streamlined progress listener handling.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
core/src/main/java/com/graphhopper/util/ProgressOutputStream.java New class to wrap an OutputStream and log progress.
core/src/main/java/com/graphhopper/util/Downloader.java Updated file download flow to incorporate progress reporting and improved buffer handling.

Copy link
Member

@aoles aoles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks a lot for adding a concise and clean solution for logging the progress of downloading elevation data! 🚀

Please find below some sample output produced with this PR. In this context I was wondering the following:

  1. The amount of produced log entries can quickly get a bit overwhelming, especially for larger spacial extents and on slower connections. In order to mitigate this issue, do you think it would be possible to reduce the logging rate from 1s to e.g. 5s? Ideally, we might even consider skipping entries unless the percentage has changed such that there would be at most. 100 entries for each downloaded file.

  2. On the conceptual level, wasn't the original suggestion by @MichaelsJP in GIScience/openrouteservice#1990 to have a moving progress bar rather than printing static lines to the terminal, or have I misunderstood it? Is this idea unfeasible or still sth to pursue? 🤔

I'm very much looking forward to your thoughts on the above points. Also, please consider my inline comment concerning the use of MB/s vs. Mbps.

Cheers! ❤️

2025-05-15 13:35:06 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   Downloading https://srtm.csi.cgiar.org/wp-content/uploads/files/srtm_5x5/TIFF//srtm_38_03.zip [38665145]
2025-05-15 13:35:07 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..   294912/38665145 (  0%) [0,26 MB/s / 0,26 MB/s] 00:01.148
2025-05-15 13:35:08 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..   655360/38665145 (  1%) [0,31 MB/s / 0,28 MB/s] 00:02.309
2025-05-15 13:35:09 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..   933888/38665145 (  2%) [0,24 MB/s / 0,27 MB/s] 00:03.463
2025-05-15 13:35:10 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  1097728/38665145 (  2%) [0,14 MB/s / 0,24 MB/s] 00:04.618
2025-05-15 13:35:12 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  1228800/38665145 (  3%) [0,12 MB/s / 0,21 MB/s] 00:05.736
2025-05-15 13:35:13 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  1392640/38665145 (  3%) [0,14 MB/s / 0,20 MB/s] 00:06.888
2025-05-15 13:35:14 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  1556480/38665145 (  4%) [0,16 MB/s / 0,20 MB/s] 00:07.913
2025-05-15 13:35:15 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  1720320/38665145 (  4%) [0,15 MB/s / 0,19 MB/s] 00:09.028
2025-05-15 13:35:16 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  1933312/38665145 (  5%) [0,18 MB/s / 0,19 MB/s] 00:10.182
2025-05-15 13:35:17 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  2162688/38665145 (  5%) [0,23 MB/s / 0,19 MB/s] 00:11.188
2025-05-15 13:35:18 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  2523136/38665145 (  6%) [0,35 MB/s / 0,21 MB/s] 00:12.221
2025-05-15 13:35:19 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  3063808/38665145 (  7%) [0,54 MB/s / 0,23 MB/s] 00:13.229
2025-05-15 13:35:20 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  3883008/38665145 ( 10%) [0,80 MB/s / 0,27 MB/s] 00:14.248
2025-05-15 13:35:21 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  5062656/38665145 ( 13%) [1,16 MB/s / 0,33 MB/s] 00:15.269
2025-05-15 13:35:22 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  6438912/38665145 ( 16%) [1,33 MB/s / 0,39 MB/s] 00:16.304
2025-05-15 13:35:23 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  7192576/38665145 ( 18%) [0,75 MB/s / 0,42 MB/s] 00:17.305
2025-05-15 13:35:24 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  7815168/38665145 ( 20%) [0,62 MB/s / 0,43 MB/s] 00:18.316
2025-05-15 13:35:25 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  8241152/38665145 ( 21%) [0,40 MB/s / 0,43 MB/s] 00:19.388
2025-05-15 13:35:26 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  8699904/38665145 ( 22%) [0,45 MB/s / 0,43 MB/s] 00:20.408
2025-05-15 13:35:27 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  9125888/38665145 ( 23%) [0,41 MB/s / 0,43 MB/s] 00:21.455
2025-05-15 13:35:28 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  9437184/38665145 ( 24%) [0,31 MB/s / 0,42 MB/s] 00:22.456
2025-05-15 13:35:29 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip ..  9781248/38665145 ( 25%) [0,34 MB/s / 0,42 MB/s] 00:23.478
2025-05-15 13:35:30 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 10108928/38665145 ( 26%) [0,32 MB/s / 0,41 MB/s] 00:24.506
2025-05-15 13:35:31 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 10436608/38665145 ( 26%) [0,31 MB/s / 0,41 MB/s] 00:25.555
2025-05-15 13:35:32 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 10780672/38665145 ( 27%) [0,34 MB/s / 0,41 MB/s] 00:26.560
2025-05-15 13:35:33 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 11108352/38665145 ( 28%) [0,29 MB/s / 0,40 MB/s] 00:27.678
2025-05-15 13:35:35 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 11370496/38665145 ( 29%) [0,23 MB/s / 0,39 MB/s] 00:28.836
2025-05-15 13:35:36 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 11632640/38665145 ( 30%) [0,25 MB/s / 0,39 MB/s] 00:29.888
2025-05-15 13:35:37 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 11845632/38665145 ( 30%) [0,20 MB/s / 0,38 MB/s] 00:30.969
2025-05-15 13:35:38 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 12091392/38665145 ( 31%) [0,24 MB/s / 0,38 MB/s] 00:31.993
2025-05-15 13:35:39 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 12337152/38665145 ( 31%) [0,23 MB/s / 0,37 MB/s] 00:33.083
2025-05-15 13:35:40 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 12599296/38665145 ( 32%) [0,25 MB/s / 0,37 MB/s] 00:34.117
2025-05-15 13:35:41 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 12812288/38665145 ( 33%) [0,20 MB/s / 0,36 MB/s] 00:35.192
2025-05-15 13:35:42 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 13041664/38665145 ( 33%) [0,22 MB/s / 0,36 MB/s] 00:36.230
2025-05-15 13:35:43 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 13287424/38665145 ( 34%) [0,23 MB/s / 0,36 MB/s] 00:37.305
2025-05-15 13:35:44 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 13565952/38665145 ( 35%) [0,27 MB/s / 0,35 MB/s] 00:38.338
2025-05-15 13:35:45 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 13828096/38665145 ( 35%) [0,24 MB/s / 0,35 MB/s] 00:39.443
2025-05-15 13:35:46 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 14123008/38665145 ( 36%) [0,29 MB/s / 0,35 MB/s] 00:40.469
2025-05-15 13:35:47 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 14467072/38665145 ( 37%) [0,31 MB/s / 0,35 MB/s] 00:41.577
2025-05-15 13:35:49 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 14991360/38665145 ( 38%) [0,46 MB/s / 0,35 MB/s] 00:42.710
2025-05-15 13:35:50 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 15663104/38665145 ( 40%) [0,67 MB/s / 0,36 MB/s] 00:43.717
2025-05-15 13:35:51 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 16482304/38665145 ( 42%) [0,81 MB/s / 0,37 MB/s] 00:44.730
2025-05-15 13:35:52 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 17252352/38665145 ( 44%) [0,77 MB/s / 0,38 MB/s] 00:45.736
2025-05-15 13:35:53 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 17874944/38665145 ( 46%) [0,59 MB/s / 0,38 MB/s] 00:46.799
2025-05-15 13:35:54 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 18497536/38665145 ( 47%) [0,61 MB/s / 0,39 MB/s] 00:47.820
2025-05-15 13:35:55 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 19054592/38665145 ( 49%) [0,55 MB/s / 0,39 MB/s] 00:48.843
2025-05-15 13:35:56 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 19529728/38665145 ( 50%) [0,46 MB/s / 0,39 MB/s] 00:49.883
2025-05-15 13:35:57 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 20004864/38665145 ( 51%) [0,46 MB/s / 0,39 MB/s] 00:50.924
2025-05-15 13:35:58 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 20365312/38665145 ( 52%) [0,36 MB/s / 0,39 MB/s] 00:51.930
2025-05-15 13:35:59 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 20742144/38665145 ( 53%) [0,37 MB/s / 0,39 MB/s] 00:52.953
2025-05-15 13:36:00 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 21118976/38665145 ( 54%) [0,38 MB/s / 0,39 MB/s] 00:53.957
2025-05-15 13:36:01 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 21495808/38665145 ( 55%) [0,37 MB/s / 0,39 MB/s] 00:54.984
2025-05-15 13:36:02 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 21807104/38665145 ( 56%) [0,31 MB/s / 0,39 MB/s] 00:55.992
2025-05-15 13:36:03 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 22134784/38665145 ( 57%) [0,26 MB/s / 0,39 MB/s] 00:57.245
2025-05-15 13:36:04 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 22364160/38665145 ( 57%) [0,22 MB/s / 0,38 MB/s] 00:58.303
2025-05-15 13:36:05 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 22593536/38665145 ( 58%) [0,22 MB/s / 0,38 MB/s] 00:59.354
2025-05-15 13:36:06 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 22790144/38665145 ( 58%) [0,19 MB/s / 0,38 MB/s] 01:00.375
2025-05-15 13:36:07 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 23003136/38665145 ( 59%) [0,20 MB/s / 0,37 MB/s] 01:01.453
2025-05-15 13:36:08 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 23248896/38665145 ( 60%) [0,23 MB/s / 0,37 MB/s] 01:02.532
2025-05-15 13:36:09 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 23494656/38665145 ( 60%) [0,24 MB/s / 0,37 MB/s] 01:03.575
2025-05-15 13:36:10 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 23724032/38665145 ( 61%) [0,21 MB/s / 0,37 MB/s] 01:04.654
2025-05-15 13:36:11 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 23986176/38665145 ( 62%) [0,25 MB/s / 0,37 MB/s] 01:05.697
2025-05-15 13:36:13 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 24248320/38665145 ( 62%) [0,24 MB/s / 0,36 MB/s] 01:06.780
2025-05-15 13:36:14 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 24510464/38665145 ( 63%) [0,26 MB/s / 0,36 MB/s] 01:07.805
2025-05-15 13:36:15 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 24756224/38665145 ( 64%) [0,23 MB/s / 0,36 MB/s] 01:08.892
2025-05-15 13:36:16 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 25001984/38665145 ( 64%) [0,24 MB/s / 0,36 MB/s] 01:09.898
2025-05-15 13:36:17 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 25296896/38665145 ( 65%) [0,29 MB/s / 0,36 MB/s] 01:10.901
2025-05-15 13:36:18 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 25559040/38665145 ( 66%) [0,25 MB/s / 0,36 MB/s] 01:11.963
2025-05-15 13:36:19 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 25837568/38665145 ( 66%) [0,27 MB/s / 0,35 MB/s] 01:13.000
2025-05-15 13:36:20 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 26165248/38665145 ( 67%) [0,30 MB/s / 0,35 MB/s] 01:14.083
2025-05-15 13:36:21 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 26542080/38665145 ( 68%) [0,37 MB/s / 0,35 MB/s] 01:15.110
2025-05-15 13:36:22 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 26820608/38665145 ( 69%) [0,28 MB/s / 0,35 MB/s] 01:16.123
2025-05-15 13:36:23 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 27197440/38665145 ( 70%) [0,34 MB/s / 0,35 MB/s] 01:17.223
2025-05-15 13:36:24 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 27525120/38665145 ( 71%) [0,33 MB/s / 0,35 MB/s] 01:18.229
2025-05-15 13:36:25 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 27836416/38665145 ( 71%) [0,30 MB/s / 0,35 MB/s] 01:19.264
2025-05-15 13:36:26 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 28098560/38665145 ( 72%) [0,25 MB/s / 0,35 MB/s] 01:20.317
2025-05-15 13:36:27 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 28377088/38665145 ( 73%) [0,25 MB/s / 0,35 MB/s] 01:21.447
2025-05-15 13:36:28 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 28639232/38665145 ( 74%) [0,24 MB/s / 0,35 MB/s] 01:22.527
2025-05-15 13:36:29 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 28884992/38665145 ( 74%) [0,24 MB/s / 0,35 MB/s] 01:23.551
2025-05-15 13:36:30 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 29163520/38665145 ( 75%) [0,28 MB/s / 0,34 MB/s] 01:24.559
2025-05-15 13:36:31 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 29425664/38665145 ( 76%) [0,26 MB/s / 0,34 MB/s] 01:25.565
2025-05-15 13:36:32 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 29655040/38665145 ( 76%) [0,22 MB/s / 0,34 MB/s] 01:26.600
2025-05-15 13:36:33 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 29949952/38665145 ( 77%) [0,29 MB/s / 0,34 MB/s] 01:27.622
2025-05-15 13:36:34 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 30228480/38665145 ( 78%) [0,28 MB/s / 0,34 MB/s] 01:28.632
2025-05-15 13:36:35 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 30523392/38665145 ( 78%) [0,29 MB/s / 0,34 MB/s] 01:29.665
2025-05-15 13:36:36 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 30801920/38665145 ( 79%) [0,28 MB/s / 0,34 MB/s] 01:30.675
2025-05-15 13:36:37 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 31047680/38665145 ( 80%) [0,24 MB/s / 0,34 MB/s] 01:31.686
2025-05-15 13:36:39 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 31309824/38665145 ( 80%) [0,26 MB/s / 0,34 MB/s] 01:32.708
2025-05-15 13:36:40 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 31588352/38665145 ( 81%) [0,26 MB/s / 0,34 MB/s] 01:33.799
2025-05-15 13:36:41 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 31834112/38665145 ( 82%) [0,24 MB/s / 0,34 MB/s] 01:34.826
2025-05-15 13:36:42 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 32079872/38665145 ( 82%) [0,24 MB/s / 0,33 MB/s] 01:35.845
2025-05-15 13:36:43 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 32325632/38665145 ( 83%) [0,23 MB/s / 0,33 MB/s] 01:36.922
2025-05-15 13:36:44 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 32604160/38665145 ( 84%) [0,25 MB/s / 0,33 MB/s] 01:38.044
2025-05-15 13:36:45 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 32866304/38665145 ( 85%) [0,26 MB/s / 0,33 MB/s] 01:39.046
2025-05-15 13:36:46 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 33062912/38665145 ( 85%) [0,19 MB/s / 0,33 MB/s] 01:40.079
2025-05-15 13:36:47 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 33193984/38665145 ( 85%) [0,12 MB/s / 0,33 MB/s] 01:41.186
2025-05-15 13:36:48 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 33325056/38665145 ( 86%) [0,13 MB/s / 0,33 MB/s] 01:42.216
2025-05-15 13:36:49 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 33488896/38665145 ( 86%) [0,15 MB/s / 0,32 MB/s] 01:43.276
2025-05-15 13:36:50 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 33669120/38665145 ( 87%) [0,18 MB/s / 0,32 MB/s] 01:44.296
2025-05-15 13:36:51 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 33865728/38665145 ( 87%) [0,19 MB/s / 0,32 MB/s] 01:45.332
2025-05-15 13:36:52 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 34111488/38665145 ( 88%) [0,23 MB/s / 0,32 MB/s] 01:46.385
2025-05-15 13:36:53 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 34439168/38665145 ( 89%) [0,31 MB/s / 0,32 MB/s] 01:47.455
2025-05-15 13:36:54 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 34668544/38665145 ( 89%) [0,20 MB/s / 0,32 MB/s] 01:48.628
2025-05-15 13:36:55 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 34897920/38665145 ( 90%) [0,23 MB/s / 0,32 MB/s] 01:49.642
2025-05-15 13:36:56 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 35143680/38665145 ( 90%) [0,24 MB/s / 0,32 MB/s] 01:50.670
2025-05-15 13:36:58 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 35373056/38665145 ( 91%) [0,20 MB/s / 0,32 MB/s] 01:51.805
2025-05-15 13:36:59 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 35618816/38665145 ( 92%) [0,24 MB/s / 0,32 MB/s] 01:52.817
2025-05-15 13:37:00 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 35815424/38665145 ( 92%) [0,19 MB/s / 0,31 MB/s] 01:53.869
2025-05-15 13:37:01 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 36012032/38665145 ( 93%) [0,19 MB/s / 0,31 MB/s] 01:54.887
2025-05-15 13:37:02 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 36159488/38665145 ( 93%) [0,15 MB/s / 0,31 MB/s] 01:55.893
2025-05-15 13:37:03 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 36290560/38665145 ( 93%) [0,13 MB/s / 0,31 MB/s] 01:56.930
2025-05-15 13:37:04 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 36438016/38665145 ( 94%) [0,14 MB/s / 0,31 MB/s] 01:57.991
2025-05-15 13:37:05 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 36585472/38665145 ( 94%) [0,12 MB/s / 0,31 MB/s] 01:59.206
2025-05-15 13:37:06 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 36716544/38665145 ( 94%) [0,12 MB/s / 0,31 MB/s] 02:00.302
2025-05-15 13:37:07 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 36864000/38665145 ( 95%) [0,13 MB/s / 0,30 MB/s] 02:01.405
2025-05-15 13:37:08 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 37060608/38665145 ( 95%) [0,17 MB/s / 0,30 MB/s] 02:02.580
2025-05-15 13:37:10 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 37257216/38665145 ( 96%) [0,17 MB/s / 0,30 MB/s] 02:03.749
2025-05-15 13:37:11 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 37437440/38665145 ( 96%) [0,14 MB/s / 0,30 MB/s] 02:05.059
2025-05-15 13:37:12 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 37650432/38665145 ( 97%) [0,18 MB/s / 0,30 MB/s] 02:06.217
2025-05-15 13:37:13 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 37847040/38665145 ( 97%) [0,17 MB/s / 0,30 MB/s] 02:07.373
2025-05-15 13:37:14 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 38043648/38665145 ( 98%) [0,17 MB/s / 0,30 MB/s] 02:08.510
2025-05-15 13:37:15 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 38256640/38665145 ( 98%) [0,19 MB/s / 0,30 MB/s] 02:09.663
2025-05-15 13:37:17 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 38436864/38665145 ( 99%) [0,16 MB/s / 0,29 MB/s] 02:10.799
2025-05-15 13:37:18 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 38665145/38665145 (100%) [0,20 MB/s / 0,29 MB/s] 02:11.962
2025-05-15 13:37:18 INFO                                    ORS-pl-driving-car [ c.g.u.Downloader                         ]   downloading srtm_38_03.zip .. 38665145/38665145 (100%) [0,00 MB/s / 0,29 MB/s] 02:11.964


this.max = max;
this.log = log;
if (max > 0) {
this.progressRenderString = "%s %%%dd/%d (%%3d%%%%) [%%.2f MB/s / %%.2f MB/s] %%s"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please consider unifying the render string format between the two scenarios when max > 0 and otherwise.
The formatting should be consistent between both strings and use either MB/s (megabytes per second) or Mbps (megabits per second). It should also match the actual calculation in the render method where the values represent megabits per second calculated via speed / (time * 1000.0). Should you, however, decide to settle on MB/s rather than Mbps you might want to adjust the corresponding formula.

Copy link
Member

@MichaelsJP MichaelsJP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool and simple approach. I agree though with @aoles, that the number of prints is overwhelming. Printing every x secs or every x % would be more sensible. I'd prefer the latter one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants