Beispiel #1
0
 masterServerHeapSummary: function () {
   var heapUsed = this.get('service').get('heapMemoryUsed');
   var heapMax = this.get('service').get('heapMemoryMax');
   var percent = heapMax > 0 ? 100 * heapUsed / heapMax : 0;
   var heapString = numberUtils.bytesToSize(heapUsed, 1, "parseFloat");
   var heapMaxString = numberUtils.bytesToSize(heapMax, 1, "parseFloat");
   return this.t('dashboard.services.hbase.masterServerHeap.summary').format(heapString, heapMaxString, percent.toFixed(1));
 }.property('service.heapMemoryUsed', 'service.heapMemoryMax'),
Beispiel #2
0
 nodeHeap: function () {
   var memUsed = this.get('service').get('jvmMemoryHeapUsed');
   var memMax = this.get('service').get('jvmMemoryHeapMax');
   var percent = memMax > 0 ? ((100 * memUsed) / memMax) : 0;
   return this.t('dashboard.services.hdfs.nodes.heapUsed').format(
     numberUtils.bytesToSize(memUsed, 1, 'parseFloat'),
     numberUtils.bytesToSize(memMax, 1, 'parseFloat'),
     percent.toFixed(1));
 }.property('service.jvmMemoryHeapUsed', 'service.jvmMemoryHeapMax'),
Beispiel #3
0
 remainingDisk: function () {
   var text = this.t("dashboard.services.hdfs.capacityUsed");
   var total = this.get('service.capacityTotal');
   var remaining = this.get('service.capacityRemaining');
   var percent = total > 0 ? ((remaining * 100) / total).toFixed(2) : 0;
   if (percent == "NaN" || percent < 0) {
     percent = Em.I18n.t('services.service.summary.notAvailable') + " ";
   }
   return text.format(numberUtils.bytesToSize(remaining, 1, 'parseFloat'), numberUtils.bytesToSize(total, 1, 'parseFloat'), percent);
 }.property('service.capacityRemaining', 'service.capacityTotal'),
Beispiel #4
0
 selectedVertexIODisplay : function() {
   var v = this.get('selectedVertex');
   var status = v.get('state');
   if (status) {
     status = stringUtils.getCamelCase(status);
   }
   var fileReadOps = v.get('fileReadOps');
   var fileWriteOps = v.get('fileWriteOps');
   var hdfsReadOps = v.get('hdfsReadOps');
   var hdfsWriteOps = v.get('hdfsWriteOps');
   var naString = Em.I18n.t('common.na');
   if (fileReadOps === null) {
     fileReadOps = naString;
   }
   if (fileWriteOps === null) {
     fileWriteOps = naString;
   }
   if (hdfsReadOps === null) {
     hdfsReadOps = naString;
   }
   if (hdfsWriteOps === null) {
     hdfsWriteOps = naString;
   }
   return {
     file : {
       read : {
         ops : Em.I18n.t('jobs.hive.tez.reads').format(fileReadOps),
         bytes : numberUtils.bytesToSize(v.get('fileReadBytes'))
       },
       write : {
         ops : Em.I18n.t('jobs.hive.tez.writes').format(fileWriteOps),
         bytes : numberUtils.bytesToSize(v.get('fileWriteBytes'))
       }
     },
     hdfs : {
       read : {
         ops : Em.I18n.t('jobs.hive.tez.reads').format(hdfsReadOps),
         bytes : numberUtils.bytesToSize(v.get('hdfsReadBytes'))
       },
       write : {
         ops : Em.I18n.t('jobs.hive.tez.writes').format(hdfsWriteOps),
         bytes : numberUtils.bytesToSize(v.get('hdfsWriteBytes'))
       }
     },
     records : {
       read : v.get('recordReadCount') == null ? null : Em.I18n.t('jobs.hive.tez.records.count').format(v.get('recordReadCount')),
       write : v.get('recordWriteCount') == null ? null : Em.I18n.t('jobs.hive.tez.records.count').format(v.get('recordWriteCount'))
     },
     started: v.get('startTime') ? dateUtils.dateFormat(v.get('startTime'), true, true) : '',
     ended: v.get('endTime') ? dateUtils.dateFormat(v.get('endTime'), true, true) : '',
     status: status
   };
 }.property('selectedVertex.fileReadOps', 'selectedVertex.fileWriteOps', 'selectedVertex.hdfsReadOps', 'selectedVertex.hdfdWriteOps',
Beispiel #5
0
 it(test.m, function() {
   expect(numberUtils.bytesToSize(test.bytes, test.precision, test.parseType, test.multiplyBy)).to.equal(test.e);
 });
Beispiel #6
0
 memory: function () {
   return Em.I18n.t('dashboard.services.yarn.memory.msg').format(
       numberUtils.bytesToSize(this.get('service.allocatedMemory'), 1, 'parseFloat', 1024 * 1024), 
       numberUtils.bytesToSize(this.get('service.reservedMemory'), 1, 'parseFloat', 1024 * 1024), 
       numberUtils.bytesToSize(this.get('service.availableMemory'), 1, 'parseFloat', 1024 * 1024));
 }.property('service.allocatedMemory', 'service.reservedMemory', 'service.availableMemory'),
  renderHostInfo: function () {
    var hostInfo = this.get('content.hosts');
    var result = [];

    for (var index in hostInfo) {
      var _host = hostInfo[index];
      if (_host.bootStatus === 'REGISTERED') {
        result.push(Em.Object.create({
          host_name: _host.name,
          cpu: _host.cpu,
          memory: _host.memory,
          disk_info: _host.disk_info,
          host_info: Em.I18n.t('installer.step5.hostInfo').fmt(_host.name, numberUtils.bytesToSize(_host.memory, 1, 'parseFloat', 1024), _host.cpu)
        }));
      }
    }
    this.set("hosts", result);
    this.sortHosts(this.get('hosts'));
    this.set('isLoaded', true);
  },
Beispiel #8
0
 calcHiddenInfo: function () {
   var total = this.get('model').get(this.get('modelFieldMax')) + 0;
   var remaining = this.get('model.capacityRemaining');
   var dfsUsed = this.get('model.capacityUsed');
   var nonDfsUsed = this.get('model.capacityNonDfsUsed');
   var dfsPercent = total > 0 ? ((dfsUsed * 100) / total).toFixed(2) : 0;
   var nonDfsPercent = total > 0 ? ((nonDfsUsed * 100) / total).toFixed(2) : 0;
   var remainingPercent = total > 0 ? ((remaining * 100) / total).toFixed(2) : 0;
   if (dfsPercent == "NaN" || dfsPercent < 0) {
     dfsPercent = Em.I18n.t('services.service.summary.notAvailable') + " ";
   }
   if (nonDfsPercent == "NaN" || nonDfsPercent < 0) {
     nonDfsPercent = Em.I18n.t('services.service.summary.notAvailable') + " ";
   }
   if (remainingPercent == "NaN" || remainingPercent < 0) {
     remainingPercent = Em.I18n.t('services.service.summary.notAvailable') + " ";
   }
   var result = [];
   result.pushObject(Em.I18n.t('dashboard.widgets.HDFSDiskUsage.DFSused'));
   result.pushObject(Em.I18n.t('dashboard.widgets.HDFSDiskUsage.info').format(numberUtils.bytesToSize(dfsUsed, 1, 'parseFloat'), dfsPercent));
   result.pushObject(Em.I18n.t('dashboard.widgets.HDFSDiskUsage.nonDFSused'));
   result.pushObject(Em.I18n.t('dashboard.widgets.HDFSDiskUsage.info').format(numberUtils.bytesToSize(nonDfsUsed, 1, 'parseFloat'), nonDfsPercent));
   result.pushObject(Em.I18n.t('dashboard.widgets.HDFSDiskUsage.remaining'));
   result.pushObject(Em.I18n.t('dashboard.widgets.HDFSDiskUsage.info').format(numberUtils.bytesToSize(remaining, 1, 'parseFloat'), remainingPercent));
   return result;
 },