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 2016/08/05 19:57:20 UTC
mesos git commit: Updated the webui to handle petabyte scale.
Repository: mesos
Updated Branches:
refs/heads/master 5bf844c0a -> cb3ef91a6
Updated the webui to handle petabyte scale.
This resolves MESOS-5929.
Review: https://reviews.apache.org/r/50862/
Project: http://git-wip-us.apache.org/repos/asf/mesos/repo
Commit: http://git-wip-us.apache.org/repos/asf/mesos/commit/cb3ef91a
Tree: http://git-wip-us.apache.org/repos/asf/mesos/tree/cb3ef91a
Diff: http://git-wip-us.apache.org/repos/asf/mesos/diff/cb3ef91a
Branch: refs/heads/master
Commit: cb3ef91a61d5cf9ca8345a3e87d9ea12c832eef4
Parents: 5bf844c
Author: Charles Allen <ch...@allen-net.com>
Authored: Fri Aug 5 12:56:22 2016 -0700
Committer: Benjamin Mahler <bm...@apache.org>
Committed: Fri Aug 5 12:56:22 2016 -0700
----------------------------------------------------------------------
src/webui/master/static/js/app.js | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/mesos/blob/cb3ef91a/src/webui/master/static/js/app.js
----------------------------------------------------------------------
diff --git a/src/webui/master/static/js/app.js b/src/webui/master/static/js/app.js
index 665c442..400a428 100644
--- a/src/webui/master/static/js/app.js
+++ b/src/webui/master/static/js/app.js
@@ -120,6 +120,9 @@
var BYTES_PER_KB = Math.pow(2, 10);
var BYTES_PER_MB = Math.pow(2, 20);
var BYTES_PER_GB = Math.pow(2, 30);
+ var BYTES_PER_TB = Math.pow(2, 40);
+ var BYTES_PER_PB = Math.pow(2, 50);
+ // NOTE: Number.MAX_SAFE_INTEGER is 2^53 - 1
return function(bytes) {
if (bytes == null || isNaN(bytes)) {
@@ -130,8 +133,12 @@
return (bytes / BYTES_PER_KB).toFixed() + ' KB';
} else if (bytes < BYTES_PER_GB) {
return (bytes / BYTES_PER_MB).toFixed() + ' MB';
- } else {
+ } else if (bytes < BYTES_PER_TB) {
return (bytes / BYTES_PER_GB).toFixed(1) + ' GB';
+ } else if (bytes < BYTES_PER_PB) {
+ return (bytes / BYTES_PER_TB).toFixed(1) + ' TB';
+ } else {
+ return (bytes / BYTES_PER_PB).toFixed(1) + ' PB';
}
};
})