Example #1
0
  private void processMetricItem(int minute, ProductLine productLine, String metricKey) {
    for (MetricType type : MetricType.values()) {
      String productlineName = productLine.getId();
      AlertResultEntity alertResult = computeAlertInfo(minute, productlineName, metricKey, type);

      if (alertResult != null && alertResult.isTriggered()) {
        String metricTitle = buildMetricTitle(metricKey);
        String mailTitle = getAlertConfig().buildMailTitle(productLine.getTitle(), metricTitle);
        m_alertInfo.addAlertInfo(metricKey, new Date().getTime());

        storeAlert(productlineName, metricTitle, mailTitle, alertResult);
        sendAlertInfo(productLine, mailTitle, alertResult.getContent(), alertResult.getAlertType());
      }
    }
  }