Package com.lanyuan.entity.ServerStatus

Examples of com.lanyuan.entity.ServerStatus.CpuInfoVo


      CpuInfo infos[] = sigar.getCpuInfoList();
      CpuPerc cpuList[] = sigar.getCpuPercList();
      double totalUse = 0L;
      for (int i = 0; i < infos.length; i++) {
        CpuPerc perc = cpuList[i];
        CpuInfoVo cpuInfo = new CpuInfoVo();
        cpuInfo.setId(infos[i].hashCode() + "");
        cpuInfo.setCacheSize(infos[i].getCacheSize());
        cpuInfo.setModel(infos[i].getModel());
        cpuInfo.setUsed(CpuPerc.format(perc.getCombined()));
        cpuInfo.setUsedOrigVal(perc.getCombined());
        cpuInfo.setIdle(CpuPerc.format(perc.getIdle()));
        cpuInfo.setTotalMHz(infos[i].getMhz());
        cpuInfo.setVendor(infos[i].getVendor());
        status.getCpuInfos().add(cpuInfo);
        totalUse += perc.getCombined();
      }
      String cpuu = CpuPerc.format(totalUse / status.getCpuInfos().size());
      cpuu = cpuu.substring(0,cpuu.length()-1);
View Full Code Here

TOP

Related Classes of com.lanyuan.entity.ServerStatus.CpuInfoVo

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.