Java 类com.vmware.vim25.VirtualMachineQuickStats 实例源码

项目:vmware-vsphere-monitoring-extension    文件:VMMetricCollector.java   
public void run() {

            VirtualMachineQuickStats vmStats = virtualMachine.getSummary().getQuickStats();

            String virtualMachineName = virtualMachine.getName();

            virtualMachineName = applyReplacers(virtualMachineName, replacers);

            String baseMetricName = baseMetricPath + "|" + "VirtualMachine" + "|" + virtualMachineName;
            printMetric(baseMetricName + "|Ballooned Memory", vmStats.getBalloonedMemory());
            printMetric(baseMetricName + "|Compressed Memory", vmStats.getCompressedMemory());
            printMetric(baseMetricName + "|Overhead Memory Consumed", vmStats.getConsumedOverheadMemory());
            printMetric(baseMetricName + "|Distributed CPU Entitlement", vmStats.getDistributedCpuEntitlement());
            printMetric(baseMetricName + "|Distributed Memory Entitlement", vmStats.getDistributedMemoryEntitlement());
            printMetric(baseMetricName + "|Guest Memory Usage", vmStats.getGuestMemoryUsage());
            printMetric(baseMetricName + "|Host Memory Usage", vmStats.getHostMemoryUsage());
            printMetric(baseMetricName + "|Overall CPU Usage", vmStats.getOverallCpuUsage());
            printMetric(baseMetricName + "|Overall CPU Demand", vmStats.getOverallCpuDemand());
            printMetric(baseMetricName + "|Private Memory", vmStats.getPrivateMemory());
            printMetric(baseMetricName + "|Shared Memory", vmStats.getSharedMemory());
            printMetric(baseMetricName + "|Static CPU Entitlement", vmStats.getStaticCpuEntitlement());
            printMetric(baseMetricName + "|Static Memory Entitlement", vmStats.getStaticMemoryEntitlement());
            printMetric(baseMetricName + "|Swapped Memory", vmStats.getSwappedMemory());
            printMetric(baseMetricName + "|Up Time", vmStats.getUptimeSeconds());

            VirtualHardware hardware = virtualMachine.getConfig().getHardware();
            printMetric(baseMetricName + "|Memory MB", hardware.getMemoryMB());
            printMetric(baseMetricName + "|Num CPU", hardware.getNumCPU());

        }