Include amount of data transferred in progress display.
This commit is contained in:
parent
d8702c5259
commit
ba44ca80e6
2 changed files with 13 additions and 9 deletions
|
@ -36,6 +36,7 @@ git-annex (6.20180228) UNRELEASED; urgency=medium
|
||||||
* Note that Remote/Git.hs now contains AGPL licensed code,
|
* Note that Remote/Git.hs now contains AGPL licensed code,
|
||||||
thus the license of git-annex as a whole is AGPL. This was already
|
thus the license of git-annex as a whole is AGPL. This was already
|
||||||
the case when git-annex was built with the webapp enabled.
|
the case when git-annex was built with the webapp enabled.
|
||||||
|
* Include amount of data transferred in progress display.
|
||||||
|
|
||||||
-- Joey Hess <id@joeyh.name> Wed, 28 Feb 2018 11:53:03 -0400
|
-- Joey Hess <id@joeyh.name> Wed, 28 Feb 2018 11:53:03 -0400
|
||||||
|
|
||||||
|
|
|
@ -355,23 +355,26 @@ clearMeterHandle (Meter _ _ v _) h = do
|
||||||
hFlush h
|
hFlush h
|
||||||
|
|
||||||
-- | Display meter in the form:
|
-- | Display meter in the form:
|
||||||
-- 10% 300 KiB/s 16m40s
|
-- 10% 1.3MiB 300 KiB/s 16m40s
|
||||||
-- or when total size is not known:
|
-- or when total size is not known:
|
||||||
-- 1.3 MiB 300 KiB/s
|
-- 1.3 MiB 300 KiB/s
|
||||||
bandwidthMeter :: RenderMeter
|
bandwidthMeter :: RenderMeter
|
||||||
bandwidthMeter mtotalsize (BytesProcessed old, before) (BytesProcessed new, now) =
|
bandwidthMeter mtotalsize (BytesProcessed old, before) (BytesProcessed new, now) =
|
||||||
unwords $ catMaybes
|
unwords $ catMaybes
|
||||||
[ Just percentoramount
|
[ Just percentamount
|
||||||
-- Pad enough for max width: "xxxx.xx KiB xxxx KiB/s"
|
-- Pad enough for max width: "100% xxxx.xx KiB xxxx KiB/s"
|
||||||
, Just $ replicate (23 - length percentoramount - length rate) ' '
|
, Just $ replicate (29 - length percentamount - length rate) ' '
|
||||||
, Just rate
|
, Just rate
|
||||||
, estimatedcompletion
|
, estimatedcompletion
|
||||||
]
|
]
|
||||||
where
|
where
|
||||||
percentoramount = case mtotalsize of
|
amount = roughSize' memoryUnits True 2 new
|
||||||
Just totalsize -> showPercentage 0 $
|
percentamount = case mtotalsize of
|
||||||
percentage totalsize (min new totalsize)
|
Just totalsize ->
|
||||||
Nothing -> roughSize' memoryUnits True 2 new
|
let p = showPercentage 0 $
|
||||||
|
percentage totalsize (min new totalsize)
|
||||||
|
in p ++ replicate (6 - length p) ' ' ++ amount
|
||||||
|
Nothing -> amount
|
||||||
rate = roughSize' memoryUnits True 0 bytespersecond ++ "/s"
|
rate = roughSize' memoryUnits True 0 bytespersecond ++ "/s"
|
||||||
bytespersecond
|
bytespersecond
|
||||||
| duration == 0 = fromIntegral transferred
|
| duration == 0 = fromIntegral transferred
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue