Package com.seyren.core.domain

Examples of com.seyren.core.domain.AlertType


        String until = Strings.emptyToNull(getString(dbo, "until"));
        BigDecimal warn = getBigDecimal(dbo, "warn");
        BigDecimal error = getBigDecimal(dbo, "error");
        boolean enabled = getBoolean(dbo, "enabled");
        boolean live = getOptionalBoolean(dbo, "live", false);
        AlertType state = AlertType.valueOf(getString(dbo, "state"));
        DateTime lastCheck = getDateTime(dbo, "lastCheck");
        List<Subscription> subscriptions = new ArrayList<Subscription>();
        BasicDBList list = getBasicDBList(dbo, "subscriptions");
        for (Object o : list) {
            subscriptions.add(subscriptionFrom((DBObject) o));
View Full Code Here


        String checkId = getString(dbo, "checkId");
        BigDecimal value = getBigDecimal(dbo, "value");
        String target = getString(dbo, "target");
        BigDecimal warn = getBigDecimal(dbo, "warn");
        BigDecimal error = getBigDecimal(dbo, "error");
        AlertType fromType = AlertType.valueOf(getString(dbo, "fromType"));
        AlertType toType = AlertType.valueOf(getString(dbo, "toType"));
        DateTime timestamp = getDateTime(dbo, "timestamp");
       
        return new Alert()
                .withId(id)
                .withCheckId(checkId)
View Full Code Here

           
            DateTime now = new DateTime();
            BigDecimal warn = check.getWarn();
            BigDecimal error = check.getError();
           
            AlertType worstState = AlertType.UNKNOWN;
           
            List<Alert> interestingAlerts = new ArrayList<Alert>();
           
            for (Entry<String, Optional<BigDecimal>> entry : targetValues.entrySet()) {
               
                String target = entry.getKey();
                Optional<BigDecimal> value = entry.getValue();
               
                if (!value.isPresent()) {
                    LOGGER.warn("No value present for {}", target);
                    continue;
                }
               
                BigDecimal currentValue = value.get();
               
                Alert lastAlert = alertsStore.getLastAlertForTargetOfCheck(target, check.getId());
               
                AlertType lastState;
               
                if (lastAlert == null) {
                    lastState = AlertType.OK;
                } else {
                    lastState = lastAlert.getToType();
                }
               
                AlertType currentState = valueChecker.checkValue(currentValue, warn, error);
               
                if (currentState.isWorseThan(worstState)) {
                    worstState = currentState;
                }
               
                if (isStillOk(lastState, currentState)) {
                    continue;
View Full Code Here

TOP

Related Classes of com.seyren.core.domain.AlertType

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.