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

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


      Date next = new Date(current.getTime() + TimeHelper.ONE_HOUR);
      Set<String> domains = queryDomains(current);
      System.out.println("Process " + m_sdf.format(current));

      for (String domain : domains) {
        TransactionReport report = m_reportService.queryTransactionReport(domain, current, next);
        ReportVisitor visitor = new ReportVisitor();

        visitor.visitTransactionReport(report);
        Index index = visitor.getIndex();
        findOrCreate(domain).add(getMonthStart(start), index);
View Full Code Here


    }
    return report;
  }

  public TransactionReport mergerAllName(TransactionReport report, String ipAddress, String allName) {
    TransactionReport temp = mergerAllIp(report, ipAddress);

    return mergerAllName(temp, allName);
  }
View Full Code Here

    super.visitRange(range);
  }

  @Override
  public void visitTransactionReport(TransactionReport transactionReport) {
    m_report = new TransactionReport(transactionReport.getDomain());
    m_report.setStartTime(transactionReport.getStartTime());
    m_report.setEndTime(transactionReport.getEndTime());
    m_report.getDomainNames().addAll(transactionReport.getDomainNames());
    m_report.getIps().addAll(transactionReport.getIps());
View Full Code Here

import com.dianping.cat.report.ReportPage;

public class XmlViewer implements Viewer<ReportPage, Action, Context, Model> {
  @Override
  public void view(Context ctx, Model model) throws ServletException, IOException {
    TransactionReport report = model.getReport();
    HttpServletResponse res = ctx.getHttpServletResponse();

    if (report != null) {
      ServletOutputStream out = res.getOutputStream();

      res.setContentType("text/xml");
      out.print(report.toString());
    } else {
      res.sendError(404, "Not found!");
    }
  }
View Full Code Here

    super.visitRange(range);
  }

  @Override
  public void visitTransactionReport(TransactionReport transactionReport) {
    m_report = new TransactionReport(transactionReport.getDomain());
    m_report.setStartTime(transactionReport.getStartTime());
    m_report.setEndTime(transactionReport.getEndTime());
    m_report.getDomainNames().addAll(transactionReport.getDomainNames());
    m_report.getIps().addAll(transactionReport.getIps());
View Full Code Here

public class TransactionReportService extends AbstractReportService<TransactionReport> {

  @Override
  public TransactionReport makeReport(String domain, Date start, Date end) {
    TransactionReport report = new TransactionReport(domain);

    report.setStartTime(start);
    report.setEndTime(end);
    return report;
  }
View Full Code Here

    return report;
  }

  @Override
  public TransactionReport queryDailyReport(String domain, Date start, Date end) {
    TransactionReportMerger merger = new TransactionReportMerger(new TransactionReport(domain));
    long startTime = start.getTime();
    long endTime = end.getTime();
    String name = TransactionAnalyzer.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) {
          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);
        }
      } catch (DalNotFoundException e) {
        // ignore
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    TransactionReport transactionReport = merger.getTransactionReport();

    transactionReport.setStartTime(start);
    transactionReport.setEndTime(end);
    return transactionReport;
  }
View Full Code Here

    DailyReportContent content = m_dailyReportContentDao.findByPK(id, DailyReportContentEntity.READSET_FULL);

    if (content != null) {
      return DefaultNativeParser.parse(content.getContent());
    } else {
      return new TransactionReport(domain);
    }
  }
View Full Code Here

    HourlyReportContent content = m_hourlyReportContentDao.findByPK(id, HourlyReportContentEntity.READSET_FULL);

    if (content != null) {
      return DefaultNativeParser.parse(content.getContent());
    } else {
      return new TransactionReport(domain);
    }
  }
View Full Code Here

    MonthlyReportContent content = m_monthlyReportContentDao.findByPK(id, MonthlyReportContentEntity.READSET_FULL);

    if (content != null) {
      return DefaultNativeParser.parse(content.getContent());
    } else {
      return new TransactionReport(domain);
    }
  }
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.