Package com.dianping.cat.core.dal

Examples of com.dianping.cat.core.dal.DailyReport


  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);
    report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
    report.setName(name);
    report.setPeriod(period);
    report.setType(1);
    byte[] binaryContent = DefaultNativeBuilder.build(crossReport);
    return m_reportService.insertDailyReport(report, binaryContent);
  }
View Full Code Here


    try {
      EventReport eventReport = queryHourlyReportsByDuration(name, domain, period, TaskHelper.tomorrowZero(period));

      buildEventDailyGraph(eventReport);

      DailyReport report = new DailyReport();

      report.setContent("");
      report.setCreationDate(new Date());
      report.setDomain(domain);
      report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
      report.setName(name);
      report.setPeriod(period);
      report.setType(1);
      byte[] binaryContent = DefaultNativeBuilder.build(eventReport);
      return m_reportService.insertDailyReport(report, binaryContent);
    } catch (Exception e) {
      Cat.logError(e);
      return false;
View Full Code Here

    processBackServer(servers, routerConfig, numbers);

    routerConfig.setStartTime(end);
    routerConfig.setEndTime(new Date(end.getTime() + TimeHelper.ONE_DAY));

    DailyReport dailyReport = new DailyReport();

    dailyReport.setContent("");
    dailyReport.setCreationDate(new Date());
    dailyReport.setDomain(domain);
    dailyReport.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
    dailyReport.setName(name);
    dailyReport.setPeriod(end);
    dailyReport.setType(1);
    byte[] binaryContent = DefaultNativeBuilder.build(routerConfig);

    m_reportService.insertDailyReport(dailyReport, binaryContent);
    return true;
  }
View Full Code Here

      Date end = TaskHelper.tomorrowZero(period);
      TransactionReport transactionReport = queryHourlyReportsByDuration(name, domain, period, end);

      buildDailyTransactionGraph(transactionReport);

      DailyReport report = new DailyReport();

      report.setCreationDate(new Date());
      report.setDomain(domain);
      report.setContent("");
      report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
      report.setName(name);
      report.setPeriod(period);
      report.setType(1);
      byte[] binaryContent = DefaultNativeBuilder.build(transactionReport);
      return m_reportService.insertDailyReport(report, binaryContent);
    } catch (Exception e) {
      m_logger.error(e.getMessage(), e);
      Cat.logError(e);
View Full Code Here

    if (config == null) {
      String name = Constants.REPORT_ROUTER;

      try {
        DailyReport report = m_dailyReportDao.findByDomainNamePeriod(domain, name, start,
              DailyReportEntity.READSET_FULL);
       
        config = queryFromDailyBinary(report.getId());

        if (config != null) {
          m_configs.put(time, config);
        }
        return config;
View Full Code Here

    long endTime = end.getTime();
    String name = Constants.REPORT_BUG;

    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) {
          BugReport reportModel = com.dianping.cat.home.bug.transform.DefaultSaxParser.parse(xml);
          reportModel.accept(merger);
        } else {
          BugReport reportModel = queryFromDailyBinary(report.getId(), domain);
          reportModel.accept(merger);
        }
      } catch (DalNotFoundException e) {
        //ignore
      } catch (Exception e) {
View Full Code Here

  protected ReportServiceManager m_reportService;

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

    report.setContent("");
    report.setCreationDate(new Date());
    report.setDomain(domain);
    report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
    report.setName(name);
    report.setPeriod(period);
    report.setType(1);
    byte[] binaryContent = DefaultNativeBuilder.build(heavyReport);
    return m_reportService.insertDailyReport(report, binaryContent);
  }
View Full Code Here

  protected ReportServiceManager m_reportService;

  @Override
  public boolean buildDailyTask(String name, String domain, Date period) {
    MatrixReport matrixReport = queryHourlyReportByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
    DailyReport report = new DailyReport();

    report.setContent("");
    report.setCreationDate(new Date());
    report.setDomain(domain);
    report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
    report.setName(name);
    report.setPeriod(period);
    report.setType(1);
    byte[] binaryContent = DefaultNativeBuilder.build(matrixReport);
    return m_reportService.insertDailyReport(report, binaryContent);
  }
View Full Code Here

    long endTime = end.getTime();
    String name = MatrixAnalyzer.ID;

    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) {
          MatrixReport reportModel = com.dianping.cat.consumer.matrix.model.transform.DefaultSaxParser.parse(xml);
          reportModel.accept(merger);
        } else {
          MatrixReport reportModel = queryFromDailyBinary(report.getId(), domain);

          reportModel.accept(merger);
        }
      } catch (DalNotFoundException e) {
        //ignore
View Full Code Here

            overload.setReportId(reportId);
            overload.setReportSize(contentLength);
            overload.setReportType(CapacityUpdater.DAILY_TYPE);

            try {
              DailyReport report = m_dailyReportDao.findByPK(reportId, DailyReportEntity.READSET_FULL);
              overload.setPeriod(report.getPeriod());
              m_overloadDao.insert(overload);
            } catch (DalNotFoundException e) {
            } catch (Exception e) {
              Cat.logError(e);
            }
View Full Code Here

TOP

Related Classes of com.dianping.cat.core.dal.DailyReport

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.