Package org.rioproject.system.measurable.cpu

Examples of org.rioproject.system.measurable.cpu.CalculableCPU


            tempUtilization = 0;           
        }
        logger.trace("{}: utilization={}", getId(), utilization);

        if(mRes instanceof CpuUtilization)
            addWatchRecord(new CalculableCPU(getId(), (CpuUtilization)mRes, now));
        else if (mRes instanceof ProcessCpuUtilization)
            addWatchRecord(new CalculableProcessCPU(getId(), (ProcessCpuUtilization)mRes, now));
        else
            addWatchRecord(new CalculableProcessCPU(getId(), mRes.getValue(), now));
       
View Full Code Here


        session.fireAllRules();
    }

    @Test
    public void testFiringWithOneCalculableCPUInserted() {
        stream.insert(new CalculableCPU("CPU", 0.4, System.currentTimeMillis()));
        session.fireAllRules();
    }
View Full Code Here

        session.fireAllRules();
    }

    @Test
    public void testFiringWithHighCPU() {
        stream.insert(new CalculableCPU("CPU", 0.8, System.currentTimeMillis()));
        DebugAgendaEventListener debugListener = new DebugAgendaEventListener();
        session.addEventListener(debugListener);
        session.fireAllRules();
        assert debugListener.hasFired();
    }
View Full Code Here

TOP

Related Classes of org.rioproject.system.measurable.cpu.CalculableCPU

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.