diff --git a/static/app.js b/static/app.js index 550708943..793841617 100644 --- a/static/app.js +++ b/static/app.js @@ -10,12 +10,49 @@ var reports = angular.module('reports', []); reports.controller('ReportsCtrl', function ($scope, $http) { - $scope.report = {}; - $scope.failure = false; + $scope.report = {}; + $scope.failure = false; + $scope.categories = [ + {key: 'totFiles', descr: 'Files Managed per Node', unit: ''}, + {key: 'maxFiles', descr: 'Files in Largest Repo', unit: ''}, + {key: 'totMiB', descr: 'Data Managed per Node', unit: 'MiB'}, + {key: 'maxMiB', descr: 'Data in Largest Repo', unit: 'MiB'}, + {key: 'numNodes', descr: 'Number of Nodes in Cluster', unit: ''}, + {key: 'numRepos', descr: 'Number of Repositories Configured', unit: ''}, + {key: 'memoryUsage', descr: 'Memory Usage', unit: 'MiB'}, + {key: 'sha256Perf', descr: 'SHA-256 Hashing Performance', unit: 'MiB/s'}, + ]; - $http.get('/report').success(function (data) { - $scope.report = data; - }).error(function () { - $scope.failure = true; - }); + $http.get('/report').success(function (data) { + $scope.report = data; + + var versions = []; + for (var ver in data.versions) { + versions.push([ver, data.versions[ver]]); + } + $scope.versions = sortedList(data.versions); + $scope.platforms = sortedList(data.platforms); + + }).error(function () { + $scope.failure = true; + }); }); + +function sortedList(d) { + var l = []; + var tot = 0; + for (var o in d) { + tot += d[o]; + } + + for (var o in d) { + l.push([o, d[o], 100 * d[o] / tot]); + } + + l.sort(function (a, b) { + if (b[1] < a[1]) + return -1; + return b[1] > a[1]; + }); + return l; +} diff --git a/static/index.html b/static/index.html index 7a92cef1a..5f096f807 100644 --- a/static/index.html +++ b/static/index.html @@ -27,11 +27,62 @@ found in the LICENSE file.
- This is the aggregated usage report data for yesterday. -
-{{ report | json}}+
+ This is the aggregated usage report data for yesterday. Data based on {{ report.nodes }} nodes that have reported in. +
+ +Min | Median | 95% | Max | +|
---|---|---|---|---|
{{cat.descr}} | +{{report[cat.key].min}} {{cat.unit}} | +{{report[cat.key].med}} {{cat.unit}} | +{{report[cat.key].nfp}} {{cat.unit}} | +{{report[cat.key].max}} {{cat.unit}} | +
Version | Nodes | Share | +
---|---|---|
{{v[0]}} | +{{v[1]}} | +{{v[2] | number:2}}% | +
Platform | Nodes | Share | +
---|---|---|
{{p[0]}} | +{{p[1]}} | +{{p[2] | number:2}}% | +