Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
';
}
function networkInterfaces() {
return secondSegments('net:');
}
function secondSegments(prefix) {
var result = [];
angular.forEach($scope.scalars, function(s) {
if(!startsWith(s.name, prefix)) {
return;
}
var seg = s.name.substr(prefix.length);
seg = seg.substr(0, seg.indexOf(':'));
for(var i=0; i
Interface
received
sent
collisions/s
';
angular.forEach(networkInterfaces(), function(iface) {
function effValue(raw) {
if(raw === 0) return 0;
if(raw < 400) return .5;
return Math.log(raw) / Math.LN10 - 2; // raw in kB/s --> 10 Gbit/s returns 7
}
function formatted(raw) { // raw is 'bytes per second'
if(raw < 1000) return raw + ' bytes/s';
raw /= 1000;
if(raw < 1000) return formatNumber(raw, 1) + ' KB/s';
raw /= 1000;
if(raw < 1000) return formatNumber(raw, 1) + ' MB/s';
raw /= 1000;
return formatNumber(raw, 1) + ' GB/s';
}
var scalarReceived = $scope.scalars['net:' + iface + ':received-bytes'];
var scalarSent = $scope.scalars['net:' + iface + ':sent-bytes'];
var scalarCollisions = $scope.scalars['net:' + iface + ':collisions'];
result += '
';
angular.forEach(diskDevs(), function(dev) {
function asDisplayedRate(raw) {
if(raw < .01) {
return 0;
}
return Math.log(raw) / Math.LN10 + 2;
}
var hasSize = $scope.scalars['disk:' + dev + ':sizeGB'];
var hasTraffic = $scope.scalars['disk:' + dev + ':read-mbytes'];
result += '
' + dev + '
';
var mp = mountPoint(dev);
if(mp) {
result += '
' + mp + '
';
}
else {
result += '
';
}
if(hasSize) {
var sizeGB = $scope.scalars['disk:' + dev + ':sizeGB'].value;
var availableGB = $scope.scalars['disk:' + dev + ':availableGB'].value;
// while 'usedGB' is available, we calculate 'size-available' because 'used+avaible' can be smaller then 'size'
result += '
';
}
if(hasTraffic) {
var scalarRead = $scope.scalars['disk:' + dev + ':read-mbytes'];
var scalarWritten = $scope.scalars['disk:' + dev + ':written-mbytes'];
var scalarRunning = $scope.scalars['disk:' + dev + ':ios-in-progress'];
result += '
';
return result;
}
function mountPoint(dev) {
var result = undefined;
angular.forEach($scope.scalars, function(s) {
if(startsWith(s.name, 'disk:' + dev + ':mountpoint:')) {
result = s.name;
result = result.substring(result.indexOf(':') + 1);
result = result.substring(result.indexOf(':') + 1);
result = result.substring(result.indexOf(':') + 1);
}
});
return result;
}
function diskDevs() {
return secondSegments('disk:');
}
function htmlForJvmMemory() {
var result = '
';
result += '
Memory Kind
Used
Comm.
Max
';
angular.forEach(memKinds(), function(memKind) {
var used = $scope.scalars['mem:' + memKind + ':used'];
var committed = $scope.scalars['mem:' + memKind + ':committed'];
var max = $scope.scalars['mem:' + memKind + ':max'];
var percent = used.value / max.value * 100;
result += '