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

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


  private ProblemReport showSummarizeReport(Model model, Payload payload) {
    String domain = model.getDomain();
    Date start = payload.getHistoryStartDate();
    Date end = payload.getHistoryEndDate();
    ProblemReport problemReport = m_reportService.queryProblemReport(domain, start, end);

    return problemReport;
  }
View Full Code Here


  @Override
  public Map<Object, Object> generateModel(String domain, Date endTime) {
    Map<Object, Object> result = new HashMap<Object, Object>();
    ModelRequest request = new ModelRequest(domain, getCurrentHour()).setProperty("queryType", "view");
    request.setProperty("type", "error");
    ProblemReport report = null;

    if (m_service.isEligable(request)) {
      ModelResponse<ProblemReport> response = m_service.invoke(request);
      report = response.getModel();
    }
View Full Code Here

      ProblemAnalyzer problemAnalyzer = (ProblemAnalyzer) lookup(MessageAnalyzer.class, ProblemAnalyzer.ID);
      ProblemDelegate problemDelegate = (ProblemDelegate) lookup(ReportDelegate.class, "problem");
      MockProblemReportManager problemManager = (MockProblemReportManager) lookup(ReportManager.class, "problem");
      xml = Files.forIO().readFrom(ProblemAnalyzerTest.class.getResourceAsStream("problem-report.xml"), "utf-8");
      ProblemReport problemReport = problemDelegate.parseXml(xml);
      problemManager.setReport(problemReport);

      m_analyzer = (TopAnalyzer) lookup(MessageAnalyzer.class, TopAnalyzer.ID);

      m_analyzer.setTransactionAnalyzer(transactionAnalyzer);
View Full Code Here

public class ProblemReportAllBuilderTest {

  @Test
  public void test() throws Exception{
    ProblemReport report = new ProblemReport("All");
    ProblemReportAllBuilder builder = new ProblemReportAllBuilder(report);
   
    String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("problem-report-builder1.xml"), "utf-8");
    String newXml = Files.forIO().readFrom(getClass().getResourceAsStream("problem-report-builder2.xml"), "utf-8");
    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("problem-report-builder-all.xml"), "utf-8");
    ProblemReport reportOld = DefaultSaxParser.parse(oldXml);
    ProblemReport reportNew = DefaultSaxParser.parse(newXml);
   
    builder.visitProblemReport(reportOld);
    builder.visitProblemReport(reportNew);
   
    Assert.assertEquals(expected.replaceAll("\r", ""), report.toString().replaceAll("\r", ""));
View Full Code Here

  @Test
  public void test() throws Exception{
    ProblemReportURLFilter problemReportURLFilter = new ProblemReportURLFilter(5);
    String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("problemURLFilter.xml"), "utf-8");
    String resultXml = Files.forIO().readFrom(getClass().getResourceAsStream("problemURLFilterResult.xml"), "utf-8");
    ProblemReport report = DefaultSaxParser.parse(oldXml);
    problemReportURLFilter.visitProblemReport(report);
   
    Assert.assertEquals(resultXml.replaceAll("\r", ""), report.toString().replaceAll("\r", ""));
   
  }
View Full Code Here

      MessageTree tree = generateMessageTree(i);

      m_analyzer.process(tree);
    }

    ProblemReport report = m_analyzer.getReport(m_domain);

    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("problem_analyzer.xml"), "utf-8");
    Assert.assertEquals(expected.replaceAll("\r", ""), report.toString().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.