Package org.rioproject.system.measurable.memory

Examples of org.rioproject.system.measurable.memory.CalculableMemory


            addWatchRecord(new CalculableSystemMemory(getId(),
                                                      utilization,
                                                      now,
                                                      (SystemMemoryUtilization)mRes));
        else
            addWatchRecord(new CalculableMemory(getId(), utilization, now));
        setLastMeasuredResource(mRes);
    }
View Full Code Here


        return utilization;
    }

    private CalculableMemory createCalculableMemory() {
        CalculableMemory  calculableMemory ;
        MeasuredResource mRes = monitor.getMeasuredResource();
        utilization = calculateUtilization(mRes);
        long now = System.currentTimeMillis();
        if(mRes instanceof ProcessMemoryUtilization)
            calculableMemory = new CalculableMemory(getId(),
                                                utilization,
                                                (ProcessMemoryUtilization)mRes,
                                                now);
        else
            calculableMemory = new CalculableMemory(getId(), utilization, now);
        setLastMeasuredResource(mRes);
        return calculableMemory;
    }
View Full Code Here

                } catch (InterruptedException e) {
                    logger.debug("JMXNotificationHandler breaking out of main loop");
                    break;
                }
                if (notification.getType().equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) {
                    CalculableMemory calculableMemory = createCalculableMemory();
                    /* We may have a reading that lags behind the notification memory threshold notification.
                     * Force the value to be greater than the high threshold */
                    if(calculableMemory.getValue()<=getThresholdValues().getCurrentHighThreshold()) {
                        logger.info("JMX MEMORY_THRESHOLD_EXCEEDED, adjusting CalculableMemory value " +
                                    "from [{}] to [{}] to enforce SLA actions to occur.",
                                    calculableMemory.getValue(),
                                    (getThresholdValues().getCurrentHighThreshold()+0.01));
                        calculableMemory.setValue(getThresholdValues().getCurrentHighThreshold()+0.01);
                    }
                    addWatchRecord(createCalculableMemory());
                }
            }
        }
View Full Code Here

    private WorkingMemoryEntryPoint stream;

    @Test
    public void testExpiration() throws InterruptedException {
        for(int i=0; i<1000; i++) {
            stream.insert(new CalculableMemory("Foo", 0.9, System.currentTimeMillis()));
            Thread.sleep(1);
            session.fireAllRules();
        }
        int wait = 1;
        while(wait <= 60) {
View Full Code Here

TOP

Related Classes of org.rioproject.system.measurable.memory.CalculableMemory

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.