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

Examples of com.dianping.cat.consumer.state.model.entity.StateReport


  private RouterConfigManager m_configManager;

  @Override
  public boolean buildDailyTask(String name, String domain, Date period) {
    Date end = new Date(period.getTime() + TimeHelper.ONE_DAY);
    StateReport report = m_reportService.queryStateReport(Constants.CAT, period, end);
    RouterConfig routerConfig = new RouterConfig(Constants.CAT);
    StateReportVisitor visitor = new StateReportVisitor();

    visitor.visitStateReport(report);
View Full Code Here


        t.complete();
      }
    }
    String domain = Constants.CAT;

    StateReport stateReport = m_reportService.queryStateReport(domain, start, end);
    m_reportService.insertMonthlyReport(buildMonthlyReport(domain, start, StateAnalyzer.ID),
          com.dianping.cat.consumer.state.model.transform.DefaultNativeBuilder.build(stateReport));
  }
View Full Code Here

        t.complete();
      }
    }
    String domain = Constants.CAT;

    StateReport stateReport = m_reportService.queryStateReport(domain, start, end);
    m_reportService.insertWeeklyReport(buildWeeklyReport(domain, start, StateAnalyzer.ID),
          com.dianping.cat.consumer.state.model.transform.DefaultNativeBuilder.build(stateReport));
  }
View Full Code Here

  @Override
  public void visitStateReport(StateReport stateReport) {
    super.visitStateReport(stateReport);

    StateReport report = getStateReport();
    report.setDomain(stateReport.getDomain());
    report.setStartTime(stateReport.getStartTime());
    report.setEndTime(stateReport.getEndTime());
  }
View Full Code Here

    return report.getDomain();
  }

  @Override
  public StateReport makeReport(String domain, long startTime, long duration) {
    StateReport report = new StateReport(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 StateReport parseXml(String xml) throws Exception {
    StateReport 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) {
    StateReport stateReport = 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("State report don't support HourReport!");
  }

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

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

  @Override
  public boolean buildWeeklyTask(String name, String domain, Date period) {
    Date start = period;
    Date end = new Date(start.getTime() + TimeHelper.ONE_DAY * 7);

    StateReport stateReport = queryDailyReportsByDuration(domain, start, end);
    WeeklyReport report = new WeeklyReport();

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

  }

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

    for (; startTime < endTime; startTime += TimeHelper.ONE_DAY) {
      try {
        StateReport reportModel = m_reportService.queryStateReport(domain, new Date(startTime), new Date(startTime
              + TimeHelper.ONE_DAY));

        reportModel.accept(merger);
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    StateReport stateReport = merger.getStateReport();

    new ClearDetailInfo().visitStateReport(stateReport);
    stateReport.setStartTime(start);
    stateReport.setEndTime(end);
    return stateReport;
  }
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.state.model.entity.StateReport

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.