Package com.dianping.cat.core.dal

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


  @Override
  public boolean buildWeeklyTask(String name, String domain, Date period) {
    UtilizationReport utilizationReport = 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(utilizationReport);

    return m_reportService.insertWeeklyReport(report, binaryContent);
  }
View Full Code Here


  }

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

      if (content != null && content.length() > 0) {
        return com.dianping.cat.consumer.event.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

  }

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

      if (content != null && content.length() > 0) {
        return com.dianping.cat.home.utilization.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) {
    MatrixReport matrixReport = 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(matrixReport);
    return m_reportService.insertWeeklyReport(report, binaryContent);
  }
View Full Code Here

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

  }

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

      if (content != null && content.length() > 0) {
        return com.dianping.cat.home.service.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 StateReport queryWeeklyReport(String domain, Date start) {
    try {
      WeeklyReport entity = m_weeklyReportDao.findReportByDomainNamePeriod(start, domain, StateAnalyzer.ID,
            WeeklyReportEntity.READSET_FULL);
      String content = entity.getContent();

      if (content != null && content.length() > 0) {
        return com.dianping.cat.consumer.state.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

  }

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

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

    for (Domain d : bugReport.getDomains().values()) {
      d.setProblemUrl(String.format("http://%s/cat/r/p?op=history&reportType=week&domain=%s&date=%s",
            getDomainName(), d.getId(), m_daily_formate.format(period)));
    }
    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(bugReport);
    return m_reportService.insertWeeklyReport(report, binaryContent);
  }
View Full Code Here

  @Override
  public boolean buildWeeklyTask(String name, String domain, Date period) {
    AlertReport alertReport = 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(alertReport);

    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.