Examples of cpu()


Examples of org.elasticsearch.monitor.os.OsStats.cpu()

        childImplementations.put(SYS, new CpuExpression(SYS) {
            @Override
            public Short value() {
               OsStats os = nodeService.stats().getOs();
                if (os != null) {
                    return os.cpu().sys();
                } else { return -1; }
            }
        });
        childImplementations.put(USER, new CpuExpression(USER) {
            @Override
View Full Code Here

Examples of org.elasticsearch.monitor.os.OsStats.cpu()

        childImplementations.put(USER, new CpuExpression(USER) {
            @Override
            public Short value() {
                OsStats os = nodeService.stats().getOs();
                if (os != null) {
                    return os.cpu().user();
                } else { return -1; }
            }
        });
        childImplementations.put(IDLE, new CpuExpression(IDLE) {
            @Override
View Full Code Here

Examples of org.elasticsearch.monitor.os.OsStats.cpu()

        childImplementations.put(IDLE, new CpuExpression(IDLE) {
            @Override
            public Short value() {
                OsStats os = nodeService.stats().getOs();
                if (os != null) {
                    return os.cpu().idle();
                } else { return -1; }
            }
        });
        childImplementations.put(USAGE, new CpuExpression(USAGE) {
            @Override
View Full Code Here

Examples of org.elasticsearch.monitor.os.OsStats.cpu()

        childImplementations.put(USAGE, new CpuExpression(USAGE) {
            @Override
            public Short value() {
                OsStats os = nodeService.stats().getOs();
                if (os != null) {
                    return (short) (os.cpu().sys() + os.cpu().user());
                } else { return -1; }
            }
        });
        childImplementations.put(STOLEN, new CpuExpression(STOLEN) {
            @Override
View Full Code Here

Examples of org.elasticsearch.monitor.os.OsStats.cpu()

        childImplementations.put(USAGE, new CpuExpression(USAGE) {
            @Override
            public Short value() {
                OsStats os = nodeService.stats().getOs();
                if (os != null) {
                    return (short) (os.cpu().sys() + os.cpu().user());
                } else { return -1; }
            }
        });
        childImplementations.put(STOLEN, new CpuExpression(STOLEN) {
            @Override
View Full Code Here

Examples of org.elasticsearch.monitor.os.OsStats.cpu()

        childImplementations.put(STOLEN, new CpuExpression(STOLEN) {
            @Override
            public Short value() {
                OsStats os = nodeService.stats().getOs();
                if (os != null) {
                    return os.cpu().stolen();
                } else { return -1; }
            }
        });
    }
}
View Full Code Here

Examples of org.elasticsearch.monitor.os.OsStats.cpu()

            when(nodeStats.getNode()).thenReturn(node);

            when(nodeStats.getOs()).thenReturn(osStats);
            when(osStats.uptime()).thenReturn(new TimeValue(3600000));
            OsStats.Cpu cpu = mock(OsStats.Cpu.class);
            when(osStats.cpu()).thenReturn(cpu);
            when(cpu.sys()).thenReturn((short) 2);
            when(cpu.user()).thenReturn((short) 4);
            when(cpu.idle()).thenReturn((short) 94);
            when(cpu.stolen()).thenReturn((short) 10);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.