Package org.hyperic.sigar

Examples of org.hyperic.sigar.CpuInfo


    return status;
  }

  public static void getServerCpuInfo(Sigar sigar, ServerStatus status) {
    try {
      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();
View Full Code Here


        if (cpuInformation != null) {
            cpuInformation.refresh();

            Cpu cpu = null;
            CpuEntry currentCpu = null;
            CpuInfo cpuInfo = null; // this is probably gonna be used for traits only

            for (MeasurementScheduleRequest request : metrics) {
                String property = request.getName();

                if (property.startsWith("Cpu.")) {
View Full Code Here

    }

    public CpuInfo getCpuInfo() {
        return null != _info
                ? _info
                : new CpuInfo();
    }
View Full Code Here

        Sigar sigar = getSigar();

        CpuInfo[] infos = sigar.getCpuInfoList();

        for (int i=0; i<infos.length; i++) {
            CpuInfo info = infos[i];

            traceln("num=" + i);
            traceln("vendor=" + info.getVendor());
            traceln("model=" + info.getModel());
            traceln("mhz=" + info.getMhz());
            traceln("cache size=" + info.getCacheSize());
            assertGtZeroTrace("totalSockets", info.getTotalSockets());
            assertGtZeroTrace("totalCores", info.getTotalCores());
            assertTrue(info.getTotalSockets() <= info.getTotalCores());
        }

        int mhz = infos[0].getMhz();
        int current = sigar.getCpuInfoList()[0].getMhz();
        assertEquals("Mhz=" + current + "/" + mhz, current, mhz);
View Full Code Here

        Sigar sigar = getSigar();

        CpuInfo[] infos = sigar.getCpuInfoList();

        for (int i=0; i<infos.length; i++) {
            CpuInfo info = infos[i];

            traceln("num=" + i);
            traceln("vendor=" + info.getVendor());
            traceln("model=" + info.getModel());
            traceln("mhz=" + info.getMhz());
            traceln("cache size=" + info.getCacheSize());
            assertGtZeroTrace("totalSockets", info.getTotalSockets());
            assertGtZeroTrace("totalCores", info.getTotalCores());
            assertTrue(info.getTotalSockets() <= info.getTotalCores());
        }

        int mhz = infos[0].getMhz();
        int current = sigar.getCpuInfoList()[0].getMhz();
        assertEquals("Mhz=" + current + "/" + mhz, current, mhz);
View Full Code Here

    }


    public static Map<String, String> getAllInfo(Sigar sigar) throws SigarException {
        Map<String, String> map = new TreeMap<String, String>();
        CpuInfo cpu = sigar.getCpuInfoList()[0];
        map.put("CPU Vendor", cpu.getVendor());
        map.put("CPU Model", cpu.getModel());
        map.put("CPU Mhz", String.valueOf(cpu.getMhz()));
        map.put("Java Vendor", System.getProperty("java.vendor"));
        map.put("Java Version", System.getProperty("java.version"));
        map.put("Java Arch DM", System.getProperty("sun.arch.data.model"));
        map.put("OS Name", System.getProperty("os.name"));
        map.put("OS Version", System.getProperty("os.version"));
View Full Code Here

        Sigar sigar = getSigar();

        CpuInfo[] infos = sigar.getCpuInfoList();

        for (int i=0; i<infos.length; i++) {
            CpuInfo info = infos[i];

            traceln("num=" + i);
            traceln("vendor=" + info.getVendor());
            traceln("model=" + info.getModel());
            traceln("mhz=" + info.getMhz());
            traceln("cache size=" + info.getCacheSize());
        }

        int mhz = infos[0].getMhz();
        int current = sigar.getCpuInfoList()[0].getMhz();
        assertEquals("Mhz=" + current + "/" + mhz, current, mhz);
View Full Code Here

TOP

Related Classes of org.hyperic.sigar.CpuInfo

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.