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

Examples of com.dianping.cat.consumer.event.model.entity.EventReport


    int transactionFlag = names.indexOf(TransactionAnalyzer.ID);
    int eventFlag = names.indexOf(EventAnalyzer.ID);
    int problemFlag = names.indexOf(ProblemAnalyzer.ID);
    Date end = new Date(start.getTime() + TimeHelper.ONE_DAY);
    TransactionReport transactionReport = m_reportService.queryTransactionReport(domain, start, end);
    EventReport eventReport = m_reportService.queryEventReport(domain, start, end);
    ProblemReport problemReport = m_reportService.queryProblemReport(domain, start, end);

    StringBuilder sb = new StringBuilder(10240);
    sb.append(m_sdf.format(start)).append("</br>");
    if (transactionFlag > -1) {
View Full Code Here


  @Test
  public void testEvent() throws Exception {
    String excepted = Files.forIO().readFrom(getClass().getResourceAsStream("EventRender.txt"), "utf-8");
    String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("Event.xml"), "utf-8");
    EventReport report = com.dianping.cat.consumer.event.model.transform.DefaultSaxParser.parse(oldXml);

    String result = m_render.renderReport(report);
    Assert.assertEquals(excepted.replaceAll("\r", ""), result.replaceAll("\r", ""));
  }
View Full Code Here

    m_logger = logger;
  }

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

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

    String domain = tree.getDomain();
    // don't process frontEnd domain
    if (Constants.FRONT_END.equals(domain)) {
      return;
    }
    EventReport report = m_reportManager.getHourlyReport(getStartTime(), domain, true);
    Message message = tree.getMessage();

    if (message instanceof Transaction) {
      processTransaction(report, tree, (Transaction) message);
    } else if (message instanceof Event) {
View Full Code Here

  @Override
  public void visitEventReport(EventReport eventReport) {
    super.visitEventReport(eventReport);

    EventReport report = getEventReport();
    report.getDomainNames().addAll(eventReport.getDomainNames());
    report.getIps().addAll(eventReport.getIps());
  }
View Full Code Here

    return report.getDomain();
  }

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

    return report;
  }
View Full Code Here

  @Override
  protected EventReport merge(ModelRequest request, List<ModelResponse<EventReport>> responses) {
    if (responses.size() == 0) {
      return null;
    }
    EventReportMerger merger = new EventReportMerger(new EventReport(request.getDomain()));
    for (ModelResponse<EventReport> response : responses) {
      EventReport model = response.getModel();
      if (model != null) {
        model.accept(merger);
      }
    }

    return merger.getEventReport();
  }
View Full Code Here

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

    if (isLocalMode()) {
      report = getReportFromLocalDisk(date, domain);
    } else {
      report = getReportFromDatabase(date, domain);
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);
    EventReport eventReport = null;

    if (StringUtils.isEmpty(type)) {
      ModelResponse<EventReport> response = m_eventService.invoke(request);

      eventReport = response.getModel();
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.event.model.entity.EventReport

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.