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

Examples of com.dianping.cat.consumer.transaction.model.entity.TransactionReport


    range.incCount();
    range.setSum(range.getSum() + d);
  }

  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


      domainNames.clear();
      domainNames.addAll(reports.keySet());
    }

    if (reports.size() > 0) {
      TransactionReport all = createAggregatedReport(reports);

      reports.put(all.getDomain(), all);
    }
  }
View Full Code Here

    return xml;
  }

  public TransactionReport createAggregatedReport(Map<String, TransactionReport> reports) {
    TransactionReport first = reports.values().iterator().next();
    TransactionReport all = makeReport(ALL, first.getStartTime().getTime(), Constants.HOUR);
    TransactionReportTypeAggregator visitor = new TransactionReportTypeAggregator(all);

    try {
      for (TransactionReport report : reports.values()) {
        String domain = report.getDomain();

        all.getIps().add(domain);
        all.getDomainNames().add(domain);

        visitor.visitTransactionReport(report);
      }
    } catch (Exception e) {
      Cat.logError(e);
View Full Code Here

    return report.getDomain();
  }

  @Override
  public TransactionReport makeReport(String domain, long startTime, long duration) {
    TransactionReport report = new TransactionReport(domain);

    report.setStartTime(new Date(startTime));
    report.setEndTime(new Date(startTime + duration - 1));

    return report;
  }
View Full Code Here

    return DefaultNativeParser.parse(bytes);
  }

  @Override
  public TransactionReport parseXml(String xml) throws Exception {
    TransactionReport report = DefaultSaxParser.parse(xml);

    return report;
  }
View Full Code Here

    TransactionReportVisitor transactionReportVisitor = new TransactionReportVisitor(topReport);

    for (String name : domains) {
      try {
        if (m_serverConfigManager.filterDomain(name) && !name.equals(Constants.ALL)) {
          TransactionReport report = m_transactionAnalyzer.getRawReport(name);

          transactionReportVisitor.visitTransactionReport(report);
        }
      } catch (ConcurrentModificationException e) {
        try {
          TransactionReport report = m_transactionAnalyzer.getRawReport(name);

          transactionReportVisitor.visitTransactionReport(report);
        } catch (ConcurrentModificationException ce) {
          Cat.logEvent("ConcurrentModificationException", name, Event.SUCCESS, null);
        }
View Full Code Here

    String domain = payload.getDomain();
    String ipAddress = payload.getIpAddress();
    String type = payload.getType();
    ModelRequest request = new ModelRequest(domain, payload.getDate()) //
          .setProperty("ip", ipAddress);
    TransactionReport transactionReport = null;

    if (StringUtils.isEmpty(type)) {
      ModelResponse<TransactionReport> response = m_transactionService.invoke(request);
      transactionReport = response.getModel();
    } else {
View Full Code Here

  @OutboundActionMeta(name = "cache")
  public void handleOutbound(Context ctx) throws ServletException, IOException {
    Model model = new Model(ctx);
    Payload payload = ctx.getPayload();
    String type = payload.getType();
    TransactionReport transactionReport = null;
    EventReport eventReport = null;

    normalize(model, payload);
    switch (payload.getAction()) {
    case HOURLY_REPORT:
View Full Code Here

  @Override
  protected TransactionReport buildModel(ModelRequest request) throws Exception {
    String domain = request.getDomain();
    long date = request.getStartTime();
    TransactionReport report;

    if (isLocalMode()) {
      report = getReportFromLocalDisk(date, domain);
    } else {
      report = getReportFromDatabase(date, domain);
View Full Code Here

    super(TransactionAnalyzer.ID);
  }

  @Override
  protected TransactionReport getReport(ModelRequest request, ModelPeriod period, String domain) throws Exception {
    TransactionReport report = super.getReport(request, period, domain);

    if (report == null && period.isLast()) {
      long startTime = request.getStartTime();
      report = getReportFromLocalDisk(startTime, domain);
     
      if (report == null) {
        report = new TransactionReport(domain);
        report.setStartTime(new Date(startTime));
        report.setEndTime(new Date(startTime + TimeHelper.ONE_HOUR - 1));
      }
    }
    return report;
  }
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.transaction.model.entity.TransactionReport

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.