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

Examples of com.dianping.cat.consumer.matrix.model.entity.MatrixReport


    m_logger = logger;
  }

  @Override
  public MatrixReport getReport(String domain) {
    MatrixReport report = m_reportManager.getHourlyReport(getStartTime(), domain, false);

    report.getDomainNames().addAll(m_reportManager.getDomains(getStartTime()));
    return report;
  }
View Full Code Here


  }

  @Override
  public void process(MessageTree tree) {
    String domain = tree.getDomain();
    MatrixReport report = m_reportManager.getHourlyReport(getStartTime(), domain, true);
    Message message = tree.getMessage();

    if (message instanceof Transaction) {
      String messageType = message.getType();

      if (m_serverConfigManager.discardTransaction((Transaction) message)) {
        return;
      }
      if (messageType.equals("URL") || messageType.equals("Service") || messageType.equals("PigeonService")) {
        Matrix matrix = report.findOrCreateMatrix(message.getName());
        matrix.setType(message.getType());
        matrix.setName(message.getName());
        long duration = ((Transaction) message).getDurationInMicros();
        matrix.incCount();
        matrix.setTotalTime(matrix.getTotalTime() + duration);
View Full Code Here

    return report.getDomain();
  }

  @Override
  public MatrixReport makeReport(String domain, long startTime, long duration) {
    MatrixReport report = new MatrixReport(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 MatrixReport parseXml(String xml) throws Exception {
    MatrixReport report = DefaultSaxParser.parse(xml);

    return report;
  }
View Full Code Here

    heavyReport.setStartTime(start);
    heavyReport.setEndTime(end);
    for (String domainName : domains) {
      if (validateDomain(domainName)) {
        MatrixReport matrixReport = m_reportService.queryMatrixReport(domainName, start, end);

        visitor.visitMatrixReport(matrixReport);
      }
    }
View Full Code Here

public class MatrixReportService extends AbstractReportService<MatrixReport> {

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

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

    return report;
  }

  @Override
  public MatrixReport queryDailyReport(String domain, Date start, Date end) {
    MatrixReportMerger merger = new MatrixReportMerger(new MatrixReport(domain));
    long startTime = start.getTime();
    long endTime = end.getTime();
    String name = MatrixAnalyzer.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) {
          MatrixReport reportModel = com.dianping.cat.consumer.matrix.model.transform.DefaultSaxParser.parse(xml);
          reportModel.accept(merger);
        } else {
          MatrixReport reportModel = queryFromDailyBinary(report.getId(), domain);

          reportModel.accept(merger);
        }
      } catch (DalNotFoundException e) {
        //ignore
      } catch (Exception e) {
        Cat.logError(e);
      }
    }
    MatrixReport matrixReport = merger.getMatrixReport();

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

  @Inject
  protected ReportServiceManager m_reportService;

  @Override
  public boolean buildDailyTask(String name, String domain, Date period) {
    MatrixReport matrixReport = queryHourlyReportByDuration(name, domain, period, TaskHelper.tomorrowZero(period));
    DailyReport report = new DailyReport();

    report.setContent("");
    report.setCreationDate(new Date());
    report.setDomain(domain);
View Full Code Here

    throw new RuntimeException("Matrix report don't support hourly report!");
  }

  @Override
  public boolean buildMonthlyTask(String name, String domain, Date period) {
    MatrixReport matrixReport = queryDailyReportsByDuration(domain, period, TaskHelper.nextMonthStart(period));
    MonthlyReport report = new MonthlyReport();

    report.setContent("");
    report.setCreationDate(new Date());
    report.setDomain(domain);
View Full Code Here

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

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

TOP

Related Classes of com.dianping.cat.consumer.matrix.model.entity.MatrixReport

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.