Package com.dianping.cat.home.dal.report

Examples of com.dianping.cat.home.dal.report.Alert


  @Inject
  private AlertDao m_alertDao;

  private Alert buildAlert(AlertEntity alertEntity, AlertMessageEntity message) {
    Alert alert = new Alert();

    alert.setDomain(alertEntity.getDomain());
    alert.setAlertTime(alertEntity.getDate());
    alert.setCategory(alertEntity.getType());
    alert.setType(alertEntity.getLevel());
    alert.setContent(message.getTitle() + "<br/>" + message.getContent());
    alert.setMetric(alertEntity.getMetric());

    return alert;
  }
View Full Code Here


  public void storeAlert(AlertEntity alertEntity, AlertMessageEntity message) {
    if (alertEntity.getType().equals(AlertType.FrontEndException.getName())) {
      return;
    }
    Alert alert = buildAlert(alertEntity, message);

    try {
      int count = m_alertDao.insert(alert);

      if (count != 1) {
        Cat.logError("insert alert error: " + alert.toString(), new RuntimeException());
      }
    } catch (DalException e) {
      Cat.logError(e);
    }
  }
View Full Code Here

TOP

Related Classes of com.dianping.cat.home.dal.report.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.