You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mesos.apache.org by bm...@apache.org on 2015/06/01 20:37:16 UTC

mesos git commit: Fixed mesos-ps memory reporting to not truncate fractional values.

Repository: mesos
Updated Branches:
  refs/heads/master f3ed959ae -> c60b2ad21


Fixed mesos-ps memory reporting to not truncate fractional values.

Review: https://reviews.apache.org/r/34887


Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/c60b2ad2
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/c60b2ad2
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/c60b2ad2

Branch: refs/heads/master
Commit: c60b2ad21be789c8dd8484b251ba2a1b32bc89b0
Parents: f3ed959
Author: weitao zhou <zh...@gmail.com>
Authored: Mon Jun 1 11:36:24 2015 -0700
Committer: Benjamin Mahler <be...@gmail.com>
Committed: Mon Jun 1 11:36:40 2015 -0700

----------------------------------------------------------------------
 src/cli/mesos-ps | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/mesos/blob/c60b2ad2/src/cli/mesos-ps
----------------------------------------------------------------------
diff --git a/src/cli/mesos-ps b/src/cli/mesos-ps
index ddd9ec5..8ca7a64 100755
--- a/src/cli/mesos-ps
+++ b/src/cli/mesos-ps
@@ -106,11 +106,11 @@ def data_size(bytes, format):
     if bytes < 1024:
         return (format % bytes) + ' B'
     elif bytes < (1024 * 1024):
-        return (format % (bytes / 1024)) + ' KB'
+        return (format % (bytes / 1024.0)) + ' KB'
     elif bytes < (1024 * 1024 * 1024):
-        return (format % (bytes / (1024 * 1024))) + ' MB'
+        return (format % (bytes / (1024.0 * 1024.0))) + ' MB'
     else:
-        return (format % (bytes / (1024 * 1024 * 1024))) + ' GB'
+        return (format % (bytes / (1024.0 * 1024.0 * 1024.0))) + ' GB'
 
 
 # Helper for formatting the TIME column for a task.