Package com.dianping.cat.core.dal

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


  }

  @Override
  public boolean insertWeeklyReport(WeeklyReport report, byte[] content) {
    try {
      WeeklyReport weeklyReport = m_weeklyReportDao.findReportByDomainNamePeriod(report.getPeriod(),
            report.getDomain(), report.getName(), WeeklyReportEntity.READSET_FULL);

      if (weeklyReport != null) {
        WeeklyReportContent reportContent = m_weeklyReportContentDao.createLocal();

        reportContent.setKeyReportId(weeklyReport.getId());
        reportContent.setReportId(weeklyReport.getId());
        m_weeklyReportContentDao.deleteByPK(reportContent);
        m_weeklyReportDao.deleteReportByDomainNamePeriod(report);
      }
    } catch (Exception e) {
      Cat.logError(e);
View Full Code Here


  @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());
    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.insertWeeklyReport(report, binaryContent);
  }
View Full Code Here

  @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());
    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.insertWeeklyReport(report, binaryContent);
  }
View Full Code Here

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

    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(transactionReport);
    return m_reportService.insertWeeklyReport(report, binaryContent);
  }
View Full Code Here

  }

  @Override
  public BugReport queryWeeklyReport(String domain, Date start) {
    try {
      WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, Constants.REPORT_BUG,
            WeeklyReportEntity.READSET_FULL);
      String content = entity.getContent();

      if (content != null && content.length() > 0) {
        return com.dianping.cat.home.bug.transform.DefaultSaxParser.parse(content);
      } else {
        return queryFromWeeklyBinary(entity.getId(), domain);
      }
    } catch (DalNotFoundException e) {
      //ignore
    } catch (Exception e) {
      Cat.logError(e);
View Full Code Here

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

    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.insertWeeklyReport(report, binaryContent);
  }
View Full Code Here

  }

  @Override
  public MatrixReport queryWeeklyReport(String domain, Date start) {
    try {
      WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, MatrixAnalyzer.ID,
            WeeklyReportEntity.READSET_FULL);
      String content = entity.getContent();

      if (content != null && content.length() > 0) {
        return com.dianping.cat.consumer.matrix.model.transform.DefaultSaxParser.parse(content);
      } else {
        return queryFromWeeklyBinary(entity.getId(), domain);
      }
    } catch (DalNotFoundException e) {
      //ignore
    } catch (Exception e) {
      Cat.logError(e);
View Full Code Here

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

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

    report.setType(1);
    return report;
  }

  private WeeklyReport buildWeeklyReport(String domain, Date period, String name) {
    WeeklyReport report = new WeeklyReport();

    report.setContent("");
    report.setCreationDate(new Date());
    report.setDomain(domain);
    report.setIp(NetworkInterfaceManager.INSTANCE.getLocalHostAddress());
    report.setName(name);
    report.setPeriod(period);
    report.setType(1);
    return report;
  }
View Full Code Here

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

    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(problemReport);
    return m_reportService.insertWeeklyReport(report, binaryContent);
  }
View Full Code Here

TOP

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

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.