diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-01-21 03:02:04 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-01-21 04:03:54 +0100 |
commit | 90bc083bda5e97064d6a97c855ef7b4868f650de (patch) | |
tree | 84e3ba489f11814e1d400cba493aa5857d03c6f4 | |
parent | 3576d6315f3b6b686cdcf9f280d5e829e3d3daa0 (diff) |
import: show download speed while downloading
-rw-r--r-- | src/import/import-job.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/import/import-job.c b/src/import/import-job.c index 6de32686c5..0b103f21b2 100644 --- a/src/import/import-job.c +++ b/src/import/import-job.c @@ -557,12 +557,17 @@ static int import_job_progress_callback(void *userdata, curl_off_t dltotal, curl char buf[FORMAT_TIMESPAN_MAX]; if (n - j->start_usec > USEC_PER_SEC && dlnow > 0) { + char y[FORMAT_BYTES_MAX]; usec_t left, done; done = n - j->start_usec; left = (usec_t) (((double) done * (double) dltotal) / dlnow) - done; - log_info("Got %u%% of %s. %s left.", percent, j->url, format_timespan(buf, sizeof(buf), left, USEC_PER_SEC)); + log_info("Got %u%% of %s. %s left at %s/s.", + percent, + j->url, + format_timespan(buf, sizeof(buf), left, USEC_PER_SEC), + format_bytes(y, sizeof(y), (uint64_t) ((double) dlnow / ((double) done / (double) USEC_PER_SEC)))); } else log_info("Got %u%% of %s.", percent, j->url); |