Package com.dianping.cat.home.utilization.entity

Examples of com.dianping.cat.home.utilization.entity.UtilizationReport.accept()


    for (; startTime < endTime; startTime += TimeHelper.ONE_DAY) {
      try {
        UtilizationReport reportModel = m_reportService.queryUtilizationReport(domain, new Date(startTime),
              new Date(startTime + TimeHelper.ONE_DAY));
        reportModel.accept(merger);
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    UtilizationReport utilizationReport = merger.getUtilizationReport();
View Full Code Here


    for (; startTime < endTime; startTime = startTime + TimeHelper.ONE_HOUR) {
      Date date = new Date(startTime);
      UtilizationReport reportModel = m_reportService.queryUtilizationReport(domain, date, new Date(date.getTime()
            + TimeHelper.ONE_HOUR));

      reportModel.accept(merger);
    }
    UtilizationReport utilizationReport = merger.getUtilizationReport();

    utilizationReport.setStartTime(start);
    utilizationReport.setEndTime(end);
View Full Code Here

              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) {
View Full Code Here

        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) {
        Cat.logError(e);
View Full Code Here

          try {
            if (xml != null && xml.length() > 0) {
              UtilizationReport reportModel = com.dianping.cat.home.utilization.transform.DefaultSaxParser
                    .parse(xml);
              reportModel.accept(merger);
            } else {
              UtilizationReport reportModel = queryFromHourlyBinary(report.getId(), domain);
              reportModel.accept(merger);
            }
          } catch (DalNotFoundException e) {
View Full Code Here

              UtilizationReport reportModel = com.dianping.cat.home.utilization.transform.DefaultSaxParser
                    .parse(xml);
              reportModel.accept(merger);
            } else {
              UtilizationReport reportModel = queryFromHourlyBinary(report.getId(), domain);
              reportModel.accept(merger);
            }
          } catch (DalNotFoundException e) {
            //ignore
          } catch (Exception e) {
            Cat.logError(e);
View Full Code Here

    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("UtilizationReportResult.xml"),
          "utf-8");
    UtilizationReportMerger merger = new UtilizationReportMerger(new UtilizationReport(reportOld.getDomain()));

    reportOld.accept(merger);
    reportNew.accept(merger);

    Assert.assertEquals("Check the merge result!", expected.replace("\r", ""), merger.getUtilizationReport()
          .toString().replace("\r", ""));
    Assert.assertEquals("Source report is changed!", newXml.replace("\r", ""), reportNew.toString().replace("\r", ""));
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.