Package com.dianping.cat.consumer.transaction.model.entity

Examples of com.dianping.cat.consumer.transaction.model.entity.TransactionReport.accept()


    for (; startTime < endTime; startTime += TimeHelper.ONE_DAY) {
      try {
        TransactionReport reportModel = m_reportService.queryTransactionReport(domain, new Date(startTime),
              new Date(startTime + TimeHelper.ONE_DAY));

        reportModel.accept(merger);
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    TransactionReport transactionReport = merger.getTransactionReport();
View Full Code Here


  private TransactionReport queryReport(String domain) {
    TransactionReport report = m_reportManager.getHourlyReport(getStartTime(), domain, false);

    report.getDomainNames().addAll(m_reportManager.getDomains(getStartTime()));
    report.accept(m_computer);

    return report;
  }
}
View Full Code Here

    for (ModelResponse<TransactionReport> response : responses) {
      if (response != null) {
        TransactionReport model = response.getModel();
        if (model != null) {
          model.accept(merger);
        }
      }
    }
    return merger.getTransactionReport();
  }
View Full Code Here

    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("HistoryTransactionMergeResult.xml"),
          "utf-8");
    TransactionReportMerger merger = new HistoryTransactionReportMerger(new TransactionReport(report1.getDomain()));

    report1.accept(merger);
    report2.accept(merger);

    String actual = new DefaultXmlBuilder().buildXml(merger.getTransactionReport());

    Assert.assertEquals("Check the merge result!", expected.replace("\r", ""), actual.replace("\r", ""));
View Full Code Here

        String xml = report.getContent();

        if (xml != null && xml.length() > 0) {
          TransactionReport reportModel = com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser
                .parse(xml);
          reportModel.accept(merger);
        } else {
          TransactionReport reportModel = queryFromDailyBinary(report.getId(), domain);

          reportModel.accept(merger);
        }
View Full Code Here

                .parse(xml);
          reportModel.accept(merger);
        } else {
          TransactionReport 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) {// for old xml storage
              TransactionReport reportModel = com.dianping.cat.consumer.transaction.model.transform.DefaultSaxParser
                    .parse(xml);
              reportModel.accept(merger);
            } else {// for new binary storage, binary is same to report id
              TransactionReport reportModel = queryFromHourlyBinary(report.getId(), domain);

              reportModel.accept(merger);
            }
View Full Code Here

                    .parse(xml);
              reportModel.accept(merger);
            } else {// for new binary storage, binary is same to report id
              TransactionReport reportModel = queryFromHourlyBinary(report.getId(), domain);

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

      m_analyzer.process(tree);
    }

    TransactionReport report = m_analyzer.getReport(m_domain);

    report.accept(new TransactionStatisticsComputer());

    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("transaction_analyzer.xml"), "utf-8");
    Assert.assertEquals(expected.replaceAll("\r", ""), report.toString().replaceAll("\r", ""));
  }
View Full Code Here

    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("transaction_report_mergeResult.xml"),
          "utf-8");
    TransactionReportMerger merger = new TransactionReportMerger(new TransactionReport(reportOld.getDomain()));

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

    Assert.assertEquals("Check the merge result!", expected.replace("\r", ""), merger.getTransactionReport()
          .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.