Package com.dianping.cat.core.dal

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


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

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


      ProblemReport problemReport = queryHourlyReportsByDuration(name, domain, period,
            TaskHelper.tomorrowZero(period));
     
      buildProblemDailyGraph(problemReport);

      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(problemReport);

      return m_reportService.insertDailyReport(report, binaryContent);
    } catch (DalException e) {
      Cat.logError(e);
View Full Code Here

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

    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) {
          UtilizationReport reportModel = com.dianping.cat.home.utilization.transform.DefaultSaxParser.parse(xml);
          reportModel.accept(merger);
        } else {
          UtilizationReport 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) {
    StateReport stateReport = 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(stateReport);
    return m_reportService.insertDailyReport(report, binaryContent);
  }
View Full Code Here

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

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

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

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

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

    long endTime = end.getTime();
    String name = EventAnalyzer.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) {
          EventReport reportModel = com.dianping.cat.consumer.event.model.transform.DefaultSaxParser.parse(xml);
          reportModel.accept(merger);
        } else {
          EventReport reportModel = queryFromDailyBinary(report.getId(), domain);

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

    long endTime = end.getTime();
    String name = CrossAnalyzer.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) {
          CrossReport reportModel = com.dianping.cat.consumer.cross.model.transform.DefaultSaxParser.parse(xml);
          reportModel.accept(merger);
        } else {
          CrossReport reportModel = queryFromDailyBinary(report.getId(), domain);

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

  Map<String, Domain> stat = new HashMap<String, Domain>();

  @Override
  public boolean buildDailyTask(String name, String domain, Date period) {
    ServiceReport serviceReport = 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(serviceReport);

    return m_reportService.insertDailyReport(report, binaryContent);
  }
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.