Package org.rhq.core.domain.measurement

Examples of org.rhq.core.domain.measurement.MeasurementReport.addData()


        // simulate a measurement report coming from the agent
        // with a single metric that makes a condition trigger but does not fire an alert
        MeasurementScheduleRequest request = new MeasurementScheduleRequest(schedule);
        MeasurementReport report = new MeasurementReport();
        report.addData(new MeasurementDataNumeric(getTimestamp(60), request, 20.0)); // 20 < 60 but !(20 > 40)
        MeasurementDataManagerLocal dataManager = LookupUtil.getMeasurementDataManager();
        dataManager.mergeMeasurementReport(report);

        // wait for our JMS messages to process and see if we get any alerts
        Thread.sleep(5000);
View Full Code Here


        MeasurementSchedule schedule = resourceWithSchedules.getSchedules().iterator().next();

        // simulate a measurement report coming from the agent - one values that fits in our range, so 1 alert is fired
        MeasurementScheduleRequest request = new MeasurementScheduleRequest(schedule);
        MeasurementReport report = new MeasurementReport();
        report.addData(new MeasurementDataNumeric(getTimestamp(15), request, 50.0)); // 50 < 60 AND 50 > 40
        MeasurementDataManagerLocal dataManager = LookupUtil.getMeasurementDataManager();
        dataManager.mergeMeasurementReport(report);

        // wait for our JMS messages to process and see if we get any alerts
        Thread.sleep(5000);
View Full Code Here

        MeasurementSchedule schedule = resourceWithSchedules.getSchedules().iterator().next();

        // simulate a measurement report coming from the agent - one values that changes value, so 1 alert is fired
        MeasurementScheduleRequest request = new MeasurementScheduleRequest(schedule);
        MeasurementReport report = new MeasurementReport();
        report.addData(new MeasurementDataTrait(getTimestamp(15), request, "Foo"));
        MeasurementDataManagerLocal dataManager = LookupUtil.getMeasurementDataManager();
        dataManager.mergeMeasurementReport(report);

        final Alert[] alertHolder = new Alert[1];
View Full Code Here

        //first, send 2 matches
        MeasurementDataManagerLocal measurementDataManager = LookupUtil.getMeasurementDataManager();
        MeasurementScheduleRequest request = new MeasurementScheduleRequest(schedule);
        MeasurementReport report = new MeasurementReport();
        report.addData(new MeasurementDataNumeric(getTimestamp(25), request, 0d));
        measurementDataManager.mergeMeasurementReport(report);

        Thread.sleep(3000);

        request = new MeasurementScheduleRequest(schedule);
View Full Code Here

        Thread.sleep(3000);

        request = new MeasurementScheduleRequest(schedule);
        report = new MeasurementReport();
        report.addData(new MeasurementDataNumeric(getTimestamp(20), request, 0d));
        measurementDataManager.mergeMeasurementReport(report);

        Thread.sleep(3000);

        //now reload the caches
View Full Code Here

        //so we need to test that if we send a non-match followed by a match we DON'T get an alert.

        //send a non-match, followed by a match
        request = new MeasurementScheduleRequest(schedule);
        report = new MeasurementReport();
        report.addData(new MeasurementDataNumeric(getTimestamp(15), request, 1d));
        measurementDataManager.mergeMeasurementReport(report);

        Thread.sleep(3000);

        request = new MeasurementScheduleRequest(schedule);
View Full Code Here

        Thread.sleep(3000);

        request = new MeasurementScheduleRequest(schedule);
        report = new MeasurementReport();
        report.addData(new MeasurementDataNumeric(getTimestamp(10), request, 0d));
        measurementDataManager.mergeMeasurementReport(report);

        Thread.sleep(3000);

        //now, we should get NO alert
View Full Code Here

        assert alerts.size() == 0 : "No alert should have fired: " + alerts;

        //let's send in 2 more matches - we should be getting an alert
        request = new MeasurementScheduleRequest(schedule);
        report = new MeasurementReport();
        report.addData(new MeasurementDataNumeric(getTimestamp(5), request, 0d));
        measurementDataManager.mergeMeasurementReport(report);

        Thread.sleep(3000);

        //throw in a cache reload to check that it doesn't mess up the counting of the positives in sequence
View Full Code Here

        //throw in a cache reload to check that it doesn't mess up the counting of the positives in sequence
        reloadAllAlertConditionCaches();

        request = new MeasurementScheduleRequest(schedule);
        report = new MeasurementReport();
        report.addData(new MeasurementDataNumeric(getTimestamp(0), request, 0d));
        measurementDataManager.mergeMeasurementReport(report);

        //wait
        Thread.sleep(5000);
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.