Package com.elastisys.scale.commons.net.smtp.alerter

Examples of com.elastisys.scale.commons.net.smtp.alerter.Alert


      LOG.info("initial desired scaling group size is {}", desiredSize());
    } catch (CloudAdapterException e) {
      String message = format(
          "failed to determine initial size of scaling group: %s\n%s",
          e.getMessage(), Throwables.getStackTraceAsString(e));
      this.eventBus.post(new Alert(AlertTopics.POOL_FETCH.name(),
          AlertSeverity.ERROR, UtcTime.now(), message));
      LOG.error(message);
    }
  }
View Full Code Here


      List<Machine> members = this.scalingGroup.listMachines();
      return new MachinePool(members, UtcTime.now());
    } catch (Exception e) {
      String message = format("failed to retrieve scaling group: %s\n%s",
          e.getMessage(), Throwables.getStackTraceAsString(e));
      this.eventBus.post(new Alert(AlertTopics.POOL_FETCH.name(),
          AlertSeverity.ERROR, UtcTime.now(), message));
      throw new CloudAdapterException(message, e);
    }
  }
View Full Code Here

    } catch (Throwable e) {
      String message = format("failed to adjust scaling group "
          + "\"%s\" to desired capacity %d: %s\n%s", scalingGroup(),
          desiredSize(), e.getMessage(),
          Throwables.getStackTraceAsString(e));
      this.eventBus.post(new Alert(AlertTopics.RESIZE.name(),
          AlertSeverity.ERROR, UtcTime.now(), message));
      throw new CloudAdapterException(message, e);
    } finally {
      this.lock.unlock();
    }
View Full Code Here

      } catch (Exception e) {
        String message = String.format(
            "failed to terminate instance %s: %s\n%s", victimId,
            e.getMessage(), Throwables.getStackTraceAsString(e));
        LOG.error(message);
        this.eventBus.post(new Alert(AlertTopics.RESIZE.name(),
            AlertSeverity.ERROR, UtcTime.now(), message));
      }
    }

    return terminated;
View Full Code Here

    List<String> startedMachineIds = Lists.newArrayList();
    for (Machine startedMachine : startedMachines) {
      startedMachineIds.add(startedMachine.getId());
    }
    tags.put("startedMachines", Joiner.on(", ").join(startedMachineIds));
    this.eventBus.post(new Alert(AlertTopics.RESIZE.name(),
        AlertSeverity.INFO, UtcTime.now(), message, tags));
  }
View Full Code Here

    for (Machine terminatedMachine : terminatedMachines) {
      terminatedMachineIds.add(terminatedMachine.getId());
    }
    tags.put("terminatedMachines",
        Joiner.on(", ").join(terminatedMachineIds));
    this.eventBus.post(new Alert(AlertTopics.RESIZE.name(),
        AlertSeverity.INFO, UtcTime.now(), message, tags));
  }
View Full Code Here

   * @param machine
   */
  private void bootAlert(Machine machine) {
    LivenessStateChange bootStateChange = new LivenessStateChange(machine,
        null, LivenessState.BOOTING);
    Alert bootAlert = bootStateChange.toAlert();
    LOG.info("liveness state change: " + bootStateChange);
    this.eventBus.post(bootAlert);
  }
View Full Code Here

    if ((previousState == null) || (previousState != newState)) {
      LivenessStateChange livenessChange = new LivenessStateChange(
          machine, previousState, newState);
      LOG.info("liveness state change: " + livenessChange);
      Alert alert = livenessChange.toAlert();
      if (livenessTestResult.getError().isPresent()) {
        alert = alert.withTag("commandError", livenessTestResult
            .getError().get().getMessage());
      }
      if (livenessTestResult.getCommandResult().isPresent()) {
        SshCommandResult command = livenessTestResult
            .getCommandResult().get();
        alert = alert.withTag("commandExitCode",
            String.valueOf(command.getExitStatus()));
        alert = alert.withTag("commandStdout", command.getStdout());
        alert = alert.withTag("commandStderr", command.getStderr());
      }
      this.eventBus.post(alert);
    }
  }
View Full Code Here

    Map<String, String> tags = Maps.newHashMap();
    tags.put("machine", this.machine.getId());
    tags.put("previousState", String.valueOf(this.previousState));
    tags.put("newState", this.newState.name());

    return new Alert(AlertTopics.LIVENESS.name(), severity,
        UtcTime.now(), message, tags);
  }
View Full Code Here

TOP

Related Classes of com.elastisys.scale.commons.net.smtp.alerter.Alert

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.