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

Examples of com.dianping.cat.consumer.cross.model.entity.CrossReport


    return report.getDomain();
  }

  @Override
  public CrossReport makeReport(String domain, long startTime, long duration) {
    CrossReport report = new CrossReport(domain);

    report.setStartTime(new Date(startTime));
    report.setEndTime(new Date(startTime + duration - 1));

    return report;
  }
View Full Code Here


    return DefaultNativeParser.parse(bytes);
  }

  @Override
  public CrossReport parseXml(String xml) throws Exception {
    CrossReport report = DefaultSaxParser.parse(xml);

    return report;
  }
View Full Code Here

  @Inject
  protected ReportServiceManager m_reportService;

  @Override
  public boolean buildDailyTask(String name, String domain, Date period) {
    CrossReport crossReport = queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
    DailyReport report = new DailyReport();

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

    throw new RuntimeException("Cross report don't support HourReport!");
  }

  @Override
  public boolean buildMonthlyTask(String name, String domain, Date period) {
    CrossReport crossReport = 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) {
    CrossReport crossReport = 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 CrossReport queryDailyReportsByDuration(String domain, Date start, Date end) {
    long startTime = start.getTime();
    long endTime = end.getTime();
    CrossReportMerger merger = new CrossReportMerger(new CrossReport(domain));

    for (; startTime < endTime; startTime += TimeHelper.ONE_DAY) {
      try {
        CrossReport reportModel = m_reportService.queryCrossReport(domain, new Date(startTime), new Date(startTime
              + TimeHelper.ONE_DAY));
        reportModel.accept(merger);
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    CrossReport crossReport = merger.getCrossReport();
    crossReport.setStartTime(start);
    crossReport.setEndTime(end);
    return crossReport;
  }
View Full Code Here

  private CrossReport queryHourlyReportsByDuration(String name, String domain, Date period, Date endDate) {
    Set<String> domainSet = m_reportService.queryAllDomainNames(period, endDate, CrossAnalyzer.ID);
    long startTime = period.getTime();
    long endTime = endDate.getTime();
    CrossReportMerger merger = new CrossReportMerger(new CrossReport(domain));

    for (; startTime < endTime; startTime = startTime + TimeHelper.ONE_HOUR) {
      Date date = new Date(startTime);
      CrossReport reportModel = m_reportService.queryCrossReport(domain, date, new Date(date.getTime()
            + TimeHelper.ONE_HOUR));

      reportModel.accept(merger);
    }
    CrossReport crossReport = merger.getCrossReport();
    crossReport.getDomainNames().addAll(domainSet);
    crossReport.setStartTime(period);
    crossReport.setEndTime(endDate);

    return crossReport;
  }
View Full Code Here

        ProblemReport problemReport = m_reportService.queryProblemReport(domain, start, end);
        m_reportService.insertMonthlyReport(buildMonthlyReport(domain, start, ProblemAnalyzer.ID),
              com.dianping.cat.consumer.problem.model.transform.DefaultNativeBuilder.build(problemReport));

        CrossReport crossReport = m_reportService.queryCrossReport(domain, start, end);
        m_reportService.insertMonthlyReport(buildMonthlyReport(domain, start, CrossAnalyzer.ID),
              com.dianping.cat.consumer.cross.model.transform.DefaultNativeBuilder.build(crossReport));

        MatrixReport matrixReport = m_reportService.queryMatrixReport(domain, start, end);
        new MatrixReportFilter().visitMatrixReport(matrixReport);
View Full Code Here

        ProblemReport problemReport = m_reportService.queryProblemReport(domain, start, end);
        m_reportService.insertWeeklyReport(buildWeeklyReport(domain, start, ProblemAnalyzer.ID),
              com.dianping.cat.consumer.problem.model.transform.DefaultNativeBuilder.build(problemReport));

        CrossReport crossReport = m_reportService.queryCrossReport(domain, start, end);
        m_reportService.insertWeeklyReport(buildWeeklyReport(domain, start, CrossAnalyzer.ID),
              com.dianping.cat.consumer.cross.model.transform.DefaultNativeBuilder.build(crossReport));

        MatrixReport matrixReport = m_reportService.queryMatrixReport(domain, start, end);
        new MatrixReportFilter().visitMatrixReport(matrixReport);
View Full Code Here

      }
    }

    for (String domainName : domains) {
      if (m_configManger.validateDomain(domainName)) {
        CrossReport crossReport = m_reportService.queryCrossReport(domainName, start, end);
        ProjectInfo projectInfo = new ProjectInfo(TimeHelper.ONE_HOUR);

        projectInfo.setHostinfoService(m_hostinfoService);
        projectInfo.setClientIp(Constants.ALL);
        projectInfo.visitCrossReport(crossReport);
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.cross.model.entity.CrossReport

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.