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

Examples of com.dianping.cat.consumer.problem.model.entity.ProblemReport


  }

  @Override
  public ProblemReport getReport(String domain) {
    if (!Constants.ALL.equals(domain)) {
      ProblemReport report = m_reportManager.getHourlyReport(getStartTime(), domain, false);

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

      return report;
    } else {
      Map<String, ProblemReport> reports = m_reportManager.getHourlyReports(getStartTime());
View Full Code Here


  }

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

    report.addIp(tree.getIpAddress());
    Machine machine = report.findOrCreateMachine(tree.getIpAddress());

    for (ProblemHandler handler : m_handlers) {
      handler.handle(machine, tree);
    }
  }
View Full Code Here

    ProblemReportVisitor problemReportVisitor = new ProblemReportVisitor(topReport);

    for (String name : domains) {
      try {
        if (m_serverConfigManager.filterDomain(name) && !name.equals(Constants.ALL)) {
          ProblemReport report = m_problemAnalyzer.getReport(name);

          problemReportVisitor.visitProblemReport(report);
        }
      } catch (ConcurrentModificationException e) {
        try {
          ProblemReport report = m_problemAnalyzer.getReport(name);

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

      node.setDes(node.getDes() + sb.toString());
    }
  }

  private String buildProblemInfo(String domain, Payload payload) {
    ProblemReport report = queryProblemReport(payload, domain);
    ProblemInfoVisitor visitor = new ProblemInfoVisitor();

    visitor.visitProblemReport(report);
    return visitor.buildExceptionInfo();
  }
View Full Code Here

    Date end = new Date(start.getTime() + TimeHelper.ONE_HOUR);
    Set<String> domains = m_reportService.queryAllDomainNames(start, end, ProblemAnalyzer.ID);

    for (String domainName : domains) {
      if (validateDomain(domainName)) {
        ProblemReport problemReport = m_reportService.queryProblemReport(domainName, start, end);
        visitor.visitProblemReport(problemReport);
      }
    }

    for (Domain d : bugReport.getDomains().values()) {
View Full Code Here

      request.setProperty("ip", ip);
    }

    if (m_transactionService.isEligable(request)) {
      ModelResponse<ProblemReport> response = m_problemService.invoke(request);
      ProblemReport report = response.getModel();

      return report;
    } else {
      throw new RuntimeException("Internal error: no eligable transaction service registered for " + request + "!");
    }
View Full Code Here

        } else if (EventAnalyzer.ID.equalsIgnoreCase(report)) {
          EventReport eventReport = getEventHourlyReport(domain, ip, type);

          buildEventReportResult(eventReport, ip, type, name, data);
        } else if (ProblemAnalyzer.ID.equalsIgnoreCase(report)) {
          ProblemReport problemReport = getProblemHourlyReport(domain, ip);

          buildProblemReportResult(problemReport, ip, type, name, data);
        }
      } else {
        Map<String, String> temp = getBaseInfoByDomianAndIp(domain, ip);
View Full Code Here

    }
  }

  @Test
  public void testForMergerDaily() throws Exception {
    ProblemReport report = m_meger.mergeForDaily(m_reportDomain, reports, m_domains);
    String expeted = Files.forIO().readFrom(getClass().getResourceAsStream("ProblemMergerDaily.xml"), "utf-8");

    Assert.assertEquals(expeted.replaceAll("\r", ""), report.toString().replaceAll("\r", ""));
  }
View Full Code Here

    Assert.assertEquals(expeted.replaceAll("\r", ""), report.toString().replaceAll("\r", ""));
  }

  @Test
  public void testForMegerGraph() throws Exception {
    ProblemReport report = m_meger.mergeForGraph(m_reportDomain, reports);
    String expeted = Files.forIO().readFrom(getClass().getResourceAsStream("ProblemMergerGraph.xml"), "utf-8");

    Assert.assertEquals(expeted.replaceAll("\r", ""), report.toString().replaceAll("\r", ""));
  }
View Full Code Here

  @Test
  public void test() throws Exception {
    ProblemGraphCreator creator = new ProblemGraphCreator();
    String xml = Files.forIO().readFrom(getClass().getResourceAsStream("problemCreator.xml"), "utf-8");
    ProblemReport report = DefaultSaxParser.parse(xml);
    String summary = Files.forIO().readFrom(getClass().getResourceAsStream("problemGraphSummary"), "utf-8");
    String detail = Files.forIO().readFrom(getClass().getResourceAsStream("problemGraphDetail"), "utf-8");
    List<Graph> graphs = creator.splitReportToGraphs(report.getStartTime(), report.getDomain(), "problem", report);

    Assert.assertEquals(2, graphs.size());
    for (Graph graph : graphs) {
      Assert.assertEquals(summary.replaceAll("\r", ""), graph.getSummaryContent().replaceAll("\r", ""));
      Assert.assertEquals(detail.replaceAll("\r", ""), graph.getDetailContent().replaceAll("\r", ""));
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.problem.model.entity.ProblemReport

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.