From de0d8cfd0f0485dba7b0c026d9826c2194e00efc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Otto=20Kek=C3=A4l=C3=A4inen?= Date: Wed, 29 Jul 2015 14:12:57 +0300 Subject: [PATCH] Multiple fixes to 'docker stats' output: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Add space between values in docker stats output for easier parsing Old output could not be parsed easily because there were columns that did not have any separator. Also values that are together without any space is difficult to read even for humans. * Update unit.HumanSize comment to match what the does actually does Signed-off-by: Otto Kekäläinen --- units/size.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/units/size.go b/units/size.go index 2fde3b4..3b59daf 100644 --- a/units/size.go +++ b/units/size.go @@ -49,7 +49,7 @@ func CustomSize(format string, size float64, base float64, _map []string) string } // HumanSize returns a human-readable approximation of a size -// using SI standard (eg. "44kB", "17MB"). +// capped at 4 valid numbers (eg. "2.746 MB", "796 KB"). func HumanSize(size float64) string { return CustomSize("%.4g %s", size, 1000.0, decimapAbbrs) }