Examples of AlertReport


Examples of com.dianping.cat.home.alert.report.entity.AlertReport

  @Inject
  private AlertSummaryExecutor m_executor;

  private void builAlertDetails(Model model, Payload payload) {
    AlertReport alertReport = queryAlertReport(payload);
    List<com.dianping.cat.home.alert.report.entity.Exception> sortedExceptions = buildSortedAlertDetails(alertReport,
          payload.getDomain());

    model.setAlertExceptions(sortedExceptions);
  }
View Full Code Here

Examples of com.dianping.cat.home.alert.report.entity.AlertReport

    model.setAlertExceptions(sortedExceptions);
  }

  private void buildAlertInfo(Model model, Payload payload) {
    AlertReport alertReport = queryAlertReport(payload);
    model.setAlertReport(alertReport);
    List<com.dianping.cat.home.alert.report.entity.Domain> sortedDomains = buildSortedAlertInfo(alertReport, model);
    model.setAlertDomains(sortedDomains);
  }
View Full Code Here

Examples of com.dianping.cat.home.alert.report.entity.AlertReport

public class AlertReportService extends AbstractReportService<AlertReport> {

  @Override
  public AlertReport makeReport(String domain, Date start, Date end) {
    AlertReport report = new AlertReport(domain);

    report.setStartTime(start);
    report.setEndTime(end);
    return report;
  }
View Full Code Here

Examples of com.dianping.cat.home.alert.report.entity.AlertReport

    return report;
  }

  @Override
  public AlertReport queryDailyReport(String domain, Date start, Date end) {
    AlertReportMerger merger = new AlertReportMerger(new AlertReport(domain));
    long startTime = start.getTime();
    long endTime = end.getTime();
    String name = Constants.REPORT_ALERT;

    for (; startTime < endTime; startTime = startTime + TimeHelper.ONE_DAY) {
      try {
        DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, new Date(startTime),
              DailyReportEntity.READSET_FULL);
        String xml = report.getContent();

        if (xml != null && xml.length() > 0) {
          AlertReport reportModel = com.dianping.cat.home.alert.report.transform.DefaultSaxParser.parse(xml);
          reportModel.accept(merger);
        } else {
          AlertReport reportModel = queryFromDailyBinary(report.getId(), domain);
          reportModel.accept(merger);
        }
      } catch (DalNotFoundException e) {
        //ignore
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    AlertReport alertReport = merger.getAlertReport();

    alertReport.setStartTime(start);
    alertReport.setEndTime(end);
    return alertReport;
  }
View Full Code Here

Examples of com.dianping.cat.home.alert.report.entity.AlertReport

    return alertReport;
  }

  @Override
  public AlertReport queryHourlyReport(String domain, Date start, Date end) {
    AlertReportMerger merger = new AlertReportMerger(new AlertReport(domain));
    long startTime = start.getTime();
    long endTime = end.getTime();
    String name = Constants.REPORT_ALERT;

    for (; startTime < endTime; startTime = startTime + TimeHelper.ONE_HOUR) {
      List<HourlyReport> reports = null;
      try {
        reports = m_hourlyReportDao.findAllByDomainNamePeriod(new Date(startTime), domain, name,
              HourlyReportEntity.READSET_FULL);
      } catch (DalException e) {
        Cat.logError(e);
      }
      if (reports != null) {
        for (HourlyReport report : reports) {
          String xml = report.getContent();

          try {
            if (xml != null && xml.length() > 0) {
              AlertReport reportModel = com.dianping.cat.home.alert.report.transform.DefaultSaxParser.parse(xml);
              reportModel.accept(merger);
            } else {
              AlertReport reportModel = queryFromHourlyBinary(report.getId(), domain);
              reportModel.accept(merger);
            }
          } catch (DalNotFoundException e) {
            //ignore
          } catch (Exception e) {
            Cat.logError(e);
          }
        }
      }
    }
    AlertReport alertReport = merger.getAlertReport();

    alertReport.setStartTime(start);
    alertReport.setEndTime(new Date(end.getTime() - 1));
   
    return alertReport;
  }
View Full Code Here

Examples of com.dianping.cat.home.alert.report.entity.AlertReport

    } catch (DalNotFoundException e) {
      //ignore
    } catch (Exception e) {
      Cat.logError(e);
    }
    return new AlertReport(domain);
  }
View Full Code Here

Examples of com.dianping.cat.home.alert.report.entity.AlertReport

    } catch (DalNotFoundException e) {
      //ignore
    } catch (Exception e) {
      Cat.logError(e);
    }
    return new AlertReport(domain);
  }
View Full Code Here

Examples of com.dianping.cat.home.alert.report.entity.AlertReport

    DailyReportContent content = m_dailyReportContentDao.findByPK(id, DailyReportContentEntity.READSET_FULL);

    if (content != null) {
      return DefaultNativeParser.parse(content.getContent());
    } else {
      return new AlertReport(domain);
    }
  }
View Full Code Here

Examples of com.dianping.cat.home.alert.report.entity.AlertReport

    HourlyReportContent content = m_hourlyReportContentDao.findByPK(id, HourlyReportContentEntity.READSET_FULL);

    if (content != null) {
      return DefaultNativeParser.parse(content.getContent());
    } else {
      return new AlertReport(domain);
    }
  }
View Full Code Here

Examples of com.dianping.cat.home.alert.report.entity.AlertReport

    MonthlyReportContent content = m_monthlyReportContentDao.findByPK(id, MonthlyReportContentEntity.READSET_FULL);

    if (content != null) {
      return DefaultNativeParser.parse(content.getContent());
    } else {
      return new AlertReport(domain);
    }
  }
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.