Package org.rioproject.impl.system.measurable.cpu

Examples of org.rioproject.impl.system.measurable.cpu.CPU.start()


        Assume.assumeTrue(!System.getProperty("os.name").startsWith("Windows"));
    }
    @Test
    public void createAndVerifyCPUClassWithSigar() {
        CPU cpu = new CPU(EmptyConfiguration.INSTANCE);
        cpu.start();
        cpu.checkValue();
        MeasuredResource mRes = cpu.getMeasuredResource();
        Assert.assertTrue("MeasuredResource should not be null", mRes!=null);
        Assert.assertTrue("MeasuredResource should be a CPUUtilization", mRes instanceof CpuUtilization);
        double utilization = cpu.getUtilization();
View Full Code Here


    public void createAndVerifyCPUWithLowerThresholdBeingCrossedWithSigar() {
        CPU cpu = new CPU(EmptyConfiguration.INSTANCE);
        ThresholdValues tVals = new ThresholdValues(0.30, 0.90);
        cpu.setThresholdValues(tVals);
        SimpleThresholdListener l = new SimpleThresholdListener();
        cpu.start();
        cpu.checkValue();
        double utilization = cpu.getUtilization();
        Assert.assertTrue("Utilization should be > 0", utilization>0);
        Assert.assertTrue(l.getType()== null);
    }
View Full Code Here

    }
    @Test
    public void createAndVerifyCPUClassWithSigar() {
        CPU cpu = new CPU(EmptyConfiguration.INSTANCE);
        Assert.assertTrue(SigarHelper.sigarAvailable());
        cpu.start();
        cpu.checkValue();
        MeasuredResource mRes = cpu.getMeasuredResource();
        Assert.assertTrue("MeasuredResource should not be null", mRes!=null);
        Assert.assertTrue("MeasuredResource should be a CPUUtilization", mRes instanceof CpuUtilization);
        double utilization = cpu.getUtilization();
View Full Code Here

    public void createAndVerifyCPUWithUpperThresholdBeingCrossedWithSigar() {
        CPU cpu = new CPU(EmptyConfiguration.INSTANCE);
        ThresholdValues tVals = new ThresholdValues(0.00, 0.05);
        cpu.setThresholdValues(tVals);
        SimpleThresholdListener l = new SimpleThresholdListener();
        cpu.start();
        cpu.checkValue();
        double utilization = cpu.getUtilization();
        Assert.assertTrue("Utilization should be > 0", utilization>0);
        Assert.assertTrue(l.getType()==null);
    }
View Full Code Here

    public void createAndVerifyCPUWithLowerThresholdBeingCrossedWithSigar() {
        CPU cpu = new CPU(EmptyConfiguration.INSTANCE);
        ThresholdValues tVals = new ThresholdValues(0.30, 0.90);
        cpu.setThresholdValues(tVals);
        SimpleThresholdListener l = new SimpleThresholdListener();
        cpu.start();
        cpu.checkValue();
        double utilization = cpu.getUtilization();
        Assert.assertTrue("Utilization should be > 0", utilization>0);
        Assert.assertTrue(l.getType()== null);
    }
View Full Code Here

    public void createAndVerifyCPUWithUpperThresholdBeingCrossedWithSigar() {
        CPU cpu = new CPU(EmptyConfiguration.INSTANCE);
        ThresholdValues tVals = new ThresholdValues(0.00, 0.05);
        cpu.setThresholdValues(tVals);
        SimpleThresholdListener l = new SimpleThresholdListener();
        cpu.start();
        cpu.checkValue();
        double utilization = cpu.getUtilization();
        Assert.assertTrue("Utilization should be > 0", utilization>0);
        Assert.assertTrue(l.getType()==null);
    }
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.