Package com.dianping.cat.consumer.event.model.entity

Examples of com.dianping.cat.consumer.event.model.entity.EventReport


  private EventReport merge(String reportDomain, List<EventReport> reports, boolean isDaily) {
    EventReportMerger merger = null;

    if (isDaily) {
      merger = new HistoryEventReportMerger(new EventReport(reportDomain));
    } else {
      merger = new EventReportMerger(new EventReport(reportDomain));
    }
    for (EventReport report : reports) {
      report.accept(merger);
    }
    return merger.getEventReport();
View Full Code Here


    }
    return merger.getEventReport();
  }

  public EventReport mergeForDaily(String reportDomain, List<EventReport> reports, Set<String> domains) {
    EventReport eventReport = merge(reportDomain, reports, true);
    HistoryEventReportMerger merger = new HistoryEventReportMerger(new EventReport(reportDomain));
    EventReport eventReport2 = merge(reportDomain, reports, true);
    Machine allMachines = merger.mergesForAllMachine(eventReport2);

    eventReport.addMachine(allMachines);
    eventReport.getIps().add("All");
    eventReport.getDomainNames().addAll(domains);
View Full Code Here

  private EventMerger m_eventMerger;

  @Override
  public boolean buildDailyTask(String name, String domain, Date period) {
    try {
      EventReport eventReport = queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));

      buildEventDailyGraph(eventReport);

      DailyReport report = new DailyReport();
View Full Code Here

    }
  }

  private List<Graph> buildHourlyGraphs(String name, String domain, Date period) throws DalException {
    long startTime = period.getTime();
    EventReport report = m_reportService.queryEventReport(domain, new Date(startTime), new Date(startTime
          + TimeHelper.ONE_HOUR));

    return m_eventGraphCreator.splitReportToGraphs(period, domain, EventAnalyzer.ID, report);
  }
View Full Code Here

    return true;
  }

  @Override
  public boolean buildMonthlyTask(String name, String domain, Date period) {
    EventReport eventReport = queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));
    MonthlyReport report = new MonthlyReport();

    report.setContent("");
    report.setCreationDate(new Date());
    report.setDomain(domain);
View Full Code Here

    return m_reportService.insertMonthlyReport(report, binaryContent);
  }

  @Override
  public boolean buildWeeklyTask(String name, String domain, Date period) {
    EventReport eventReport = queryDailyReportsByDuration(domain, period, new Date(period.getTime()
          + TimeHelper.ONE_WEEK));
    WeeklyReport report = new WeeklyReport();

    report.setContent("");
    report.setCreationDate(new Date());
View Full Code Here

  }

  private EventReport queryDailyReportsByDuration(String domain, Date start, Date end) {
    long startTime = start.getTime();
    long endTime = end.getTime();
    EventReportMerger merger = new EventReportMerger(new EventReport(domain));

    for (; startTime < endTime; startTime += TimeHelper.ONE_DAY) {
      try {
        EventReport reportModel = m_reportService.queryEventReport(domain, new Date(startTime), new Date(startTime
              + TimeHelper.ONE_DAY));
        reportModel.accept(merger);
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    EventReport eventReport = merger.getEventReport();

    eventReport.setStartTime(start);
    eventReport.setEndTime(end);
   
    new EventReportCountFilter().visitEventReport(eventReport);
    return eventReport;
  }
View Full Code Here

    List<EventReport> reports = new ArrayList<EventReport>();
    long startTime = start.getTime();
    long endTime = end.getTime();

    for (; startTime < endTime; startTime = startTime + TimeHelper.ONE_HOUR) {
      EventReport report = m_reportService.queryEventReport(domain, new Date(startTime), new Date(startTime
            + TimeHelper.ONE_HOUR));

      reports.add(report);
    }
    return m_eventMerger.mergeForDaily(domain, reports, domainSet);
View Full Code Here

        new TransactionReportCountFilter().visitTransactionReport(transactionReport);

        m_reportService.insertMonthlyReport(buildMonthlyReport(domain, start, TransactionAnalyzer.ID),
              com.dianping.cat.consumer.transaction.model.transform.DefaultNativeBuilder.build(transactionReport));

        EventReport eventReport = m_reportService.queryEventReport(domain, start, end);
        m_reportService.insertMonthlyReport(buildMonthlyReport(domain, start, EventAnalyzer.ID),
              com.dianping.cat.consumer.event.model.transform.DefaultNativeBuilder.build(eventReport));

        ProblemReport problemReport = m_reportService.queryProblemReport(domain, start, end);
        m_reportService.insertMonthlyReport(buildMonthlyReport(domain, start, ProblemAnalyzer.ID),
View Full Code Here

        new TransactionReportCountFilter().visitTransactionReport(transactionReport);

        m_reportService.insertWeeklyReport(buildWeeklyReport(domain, start, TransactionAnalyzer.ID),
              com.dianping.cat.consumer.transaction.model.transform.DefaultNativeBuilder.build(transactionReport));

        EventReport eventReport = m_reportService.queryEventReport(domain, start, end);
        new EventReportCountFilter().visitEventReport(eventReport);
       
        m_reportService.insertWeeklyReport(buildWeeklyReport(domain, start, EventAnalyzer.ID),
              com.dianping.cat.consumer.event.model.transform.DefaultNativeBuilder.build(eventReport));
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.event.model.entity.EventReport

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.