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

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


    } catch (DalNotFoundException e) {
      //ignore
    } catch (Exception e) {
      Cat.logError(e);
    }
    return new EventReport(domain);
  }
View Full Code Here


        if (TransactionAnalyzer.ID.equalsIgnoreCase(report)) {
          TransactionReport transactionReport = getTransactionHourlyReport(domain, ip, type);

          buildTransactionReportResult(transactionReport, ip, type, name, data);
        } 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);
View Full Code Here

    } catch (DalNotFoundException e) {
      //ignore
    } catch (Exception e) {
      Cat.logError(e);
    }
    return new EventReport(domain);
  }
View Full Code Here

public class EventReportFilterTest {
  @Test
  public void test() throws Exception {
    String source = Files.forIO().readFrom(getClass().getResourceAsStream("event_filter.xml"), "utf-8");
    EventReport report = DefaultSaxParser.parse(source);

    EventReportFilter f1 = new EventReportFilter(null, null, null);
    String expected1 = Files.forIO().readFrom(getClass().getResourceAsStream("event_filter_type.xml"), "utf-8");

    Assert.assertEquals(expected1.replaceAll("\r", ""), f1.buildXml(report).replaceAll("\r", ""));
View Full Code Here

    }
  }

  @Test
  public void testForMergerDaily() throws Exception {
    EventReport report = m_meger.mergeForDaily(m_reportDomain, reports, m_domains);
    String expeted = Files.forIO().readFrom(getClass().getResourceAsStream("EventMergerDaily.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", ""));
  }

  private EventReport creatReport() {
    EventReport result = new EventReport();
    try {
      String xml = Files.forIO().readFrom(getClass().getResourceAsStream("BaseEventReport.xml"), "utf-8");
     
      return DefaultSaxParser.parse(xml);
    } catch (Exception e) {
View Full Code Here

  @Test
  public void testSplitReportToGraphs() throws Exception {
    EventGraphCreator creator = new EventGraphCreator();
    String xml = Files.forIO().readFrom(getClass().getResourceAsStream("BaseEventGraphReport.xml"), "utf-8");
    EventReport report = DefaultSaxParser.parse(xml);
    List<Graph> graphs = creator.splitReportToGraphs(report.getStartTime(), report.getDomain(), "event", report);

    // List<Graph> graphs = creator.buildGraph(report);
    Map<String, Range> realResult = new HashMap<String, Range>();
    Map<String, Range> excepectedResult = buildExceptedResult();
    buildResultResult(graphs, realResult);
View Full Code Here

public class HistoryEventMergerTest {
  @Test
  public void testMerge() throws Exception {
    String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("HistoryBaseEvent.xml"), "utf-8");
    EventReport report1 = DefaultSaxParser.parse(oldXml);
    EventReport report2 = DefaultSaxParser.parse(oldXml);
    String expected = Files.forIO().readFrom(getClass().getResourceAsStream("HistoryEventMergerDaily.xml"), "utf-8");
    EventReportMerger merger = new HistoryEventReportMerger(new EventReport(report1.getDomain()));

    report1.accept(merger);
    report2.accept(merger);

    String actual = new DefaultXmlBuilder().buildXml(merger.getEventReport());

    Assert.assertEquals("Check the merge result!", expected.replace("\r", ""), actual.replace("\r", ""));
  }
View Full Code Here

      request.setProperty("name", "*");
      request.setProperty("all", "true");
      name = Constants.ALL;
    }
    ModelResponse<EventReport> response = m_service.invoke(request);
    EventReport report = response.getModel();

    return report;
  }
View Full Code Here

          .setProperty("type", payload.getType())//
          .setProperty("ip", ipAddress);

    if (m_service.isEligable(request)) {
      ModelResponse<EventReport> response = m_service.invoke(request);
      EventReport report = response.getModel();

      if (payload.getPeriod().isLast()) {
        Set<String> domains = m_reportService.queryAllDomainNames(new Date(payload.getDate()),
              new Date(payload.getDate() + TimeHelper.ONE_HOUR), EventAnalyzer.ID);
        Set<String> domainNames = report.getDomainNames();

        domainNames.addAll(domains);
      }
      return report;
    } else {
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.