Examples of AvailabilityType


Examples of org.rhq.core.domain.measurement.AvailabilityType

  
   abstract File getConfigurationPath();
    
   @Override
   public AvailabilityType getAvailability() {
     AvailabilityType av = super.getAvailability();
     return av;
   }
View Full Code Here

Examples of org.rhq.core.domain.measurement.AvailabilityType

    protected AvailabilityType getAvailability(Resource resource) throws PluginContainerException {
        ResourceContainer resourceContainer = this.pluginContainer.getInventoryManager().getResourceContainer(resource);
        long timeoutMillis = 5000;
        AvailabilityFacet availFacet = resourceContainer.createResourceComponentProxy(AvailabilityFacet.class,
            FacetLockType.READ, timeoutMillis, false, false, false);
        AvailabilityType avail;
        try {
            avail = availFacet.getAvailability();
        } catch (Exception e) {
            System.out.println("====== Error occurred during availability check on " + resource + ": " + e);
            throw new RuntimeException("Error occurred during availability check on " + resource + ": " + e);
View Full Code Here

Examples of org.rhq.core.domain.measurement.AvailabilityType

            long t1 = System.currentTimeMillis() - (MULTI * MILLIS_APART);
            for (int i = 0; i < MULTI; i++) {

                AvailabilityReport report = new AvailabilityReport(agent.getName());
                for (Resource r : resources) {
                    AvailabilityType at = (i % 2 == 0) ? AvailabilityType.UP : AvailabilityType.DOWN;
                    Availability a = new Availability(r, (t1 + i * MILLIS_APART), at);
                    report.addAvailability(a);
                }
                startTiming(round);
                availabilityManager.mergeAvailabilityReport(report);
View Full Code Here

Examples of org.rhq.core.domain.measurement.AvailabilityType

                int unknownCount = unknown;
                int disabledCount = disabled;
                int uncommittedCount = uncommitted;
                System.out.print("=====> Creating member Resources (this might take some time)...");
                for (int i = 1; i <= groupSize; i++) {
                    AvailabilityType avail;
                    InventoryStatus inventoryStatus = InventoryStatus.COMMITTED;
                    if (downCount > 0) {
                        avail = AvailabilityType.DOWN;
                        downCount--;
                    } else if (unknownCount > 0) {
View Full Code Here

Examples of org.rhq.core.domain.measurement.AvailabilityType

            // the agent should be suspect and will be considered down, the platform resource should be down
            // (although children should be UNKNOWN)
            LookupUtil.getAgentManager().checkForSuspectAgents(); // checks for 5 mins !!
            // UNKNOWN(0) --> UP(-12000000) -->DOWN(now) -->           
            AvailabilityType curAvail;
            curAvail = availabilityManager.getCurrentAvailabilityTypeForResource(overlord, theResource.getId());
            assert curAvail == DOWN : curAvail;

            // make sure our resource's new availabilities are consistent (first (UNKNOWN) , second (UP), third (DOWN))
            beginTx();
View Full Code Here

Examples of org.rhq.core.domain.measurement.AvailabilityType

            LookupUtil.getAgentManager().checkForSuspectAgents();

            System.out.println("testAgentBackfillPerformance: checkForSuspectAgents run 2 took "
                + (System.currentTimeMillis() - start) + "ms");

            AvailabilityType curAvail;
            start = System.currentTimeMillis();
            resNum = 0;

            for (Resource resource : allResources) {
                curAvail = availabilityManager.getCurrentAvailabilityTypeForResource(overlord, resource.getId());
                AvailabilityType expected = (0 == resNum) ? DOWN : ((resNum > 80) ? DISABLED : UNKNOWN);
                ++resNum;
                assert curAvail == expected : "Expected " + expected.name() + " but got " + curAvail.name() + " for "
                    + resource;

                // make sure our resources' new availabilities are consistent
                // the first time we backfilled everything was unknown, only the platform was updated.
                // later we went UP/DISABLED then DOWN so we'll have 2, 3 or 4 rows)
View Full Code Here

Examples of org.rhq.core.domain.measurement.AvailabilityType

            //check for current availability.
            Date unknownTime = new Date(avail.getStartTime() - 2);
            //make request for avail again but this time requesting most up to date status: should be DOWN
            List<AvailabilityPoint> list = availabilityManager.findAvailabilitiesForResource(overlord,
                theResource.getId(), unknownTime.getTime(), unknownTime.getTime() + 1, 1, true);
            AvailabilityType returnedAvail = list.get(0).getAvailabilityType();
            assert returnedAvail == DOWN : "Expected current avail to be '" + DOWN + "' but was '" + returnedAvail
                + "'.";
        } catch (Exception e) {
            e.printStackTrace();
            throw e;
View Full Code Here

Examples of org.rhq.core.domain.measurement.AvailabilityType

            availabilityManager.mergeAvailabilityReport(report);

            System.out.println("testMergeReportPerformance: mergeAvailabilityReport run 1 took "
                + (System.currentTimeMillis() - start) + "ms");

            AvailabilityType curAvail;
            start = System.currentTimeMillis();

            for (Resource resource : allResources) {
                curAvail = availabilityManager.getCurrentAvailabilityTypeForResource(overlord, resource.getId());
                assert curAvail == UP : curAvail;
View Full Code Here

Examples of org.rhq.core.domain.measurement.AvailabilityType

    private AvailabilityType getPointInTime(Date time) {
        List<AvailabilityPoint> list = availabilityManager.findAvailabilitiesForResource(overlord, theResource.getId(),
            time.getTime(), time.getTime() + 1, 1, false);
        assert list != null;
        assert list.size() == 1 : "Should have returned a single point";
        AvailabilityType type = list.get(0).getAvailabilityType();

        switch (type) {
        case UP:
        case DOWN:
        case DISABLED:
View Full Code Here

Examples of org.rhq.core.domain.measurement.AvailabilityType

            long t1 = System.currentTimeMillis() - (MULTI * MILLIS_APART);
            for (int i = 0; i < MULTI; i++) {

                AvailabilityReport report = new AvailabilityReport(agent.getName());
                for (Resource r : resources) {
                    AvailabilityType at = (i % 2 == 0) ? AvailabilityType.UP : AvailabilityType.DOWN;
                    Availability a = new Availability(r, (t1 + i * MILLIS_APART), at);
                    report.addAvailability(a);
                }
                startTiming(round);
                availabilityManager.mergeAvailabilityReport(report);
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.