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

Examples of com.dianping.cat.consumer.transaction.model.entity.TransactionReport


    for (String domain : domains) {
      if (m_configManger.validateDomain(domain)) {
        Transaction t = Cat.newTransaction("ReloadTask", "Reload-Week-" + domain);

        TransactionReport transactionReport = m_reportService.queryTransactionReport(domain, start, end);
        new TransactionReportCountFilter().visitTransactionReport(transactionReport);

        m_reportService.insertWeeklyReport(buildWeeklyReport(domain, start, TransactionAnalyzer.ID),
              com.dianping.cat.consumer.transaction.model.transform.DefaultNativeBuilder.build(transactionReport));
View Full Code Here


          .setUtilizationReport(utilizationReport);
    HeartbeatReportVisitor heartbeatVisitor = new HeartbeatReportVisitor().setUtilizationReport(utilizationReport);

    for (String domainName : domains) {
      if (m_configManger.validateDomain(domainName)) {
        TransactionReport transactionReport = m_reportService.queryTransactionReport(domainName, start, end);
        int size = transactionReport.getMachines().size();

        utilizationReport.findOrCreateDomain(domainName).setMachineNumber(size);
        transactionReport = m_mergeManager.mergerAllIp(transactionReport, Constants.ALL);
        transactionVisitor.visitTransactionReport(transactionReport);
      }
View Full Code Here

  private String renderContent(String names, String domain, Date start) {
    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>");
View Full Code Here

  @Test
  public void testTransaction() throws Exception {
    String excepted = Files.forIO().readFrom(getClass().getResourceAsStream("TransactionRender.txt"), "utf-8");
    String oldXml = Files.forIO().readFrom(getClass().getResourceAsStream("Transaction.xml"), "utf-8");
    TransactionReport report = DefaultSaxParser.parse(oldXml);

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

  }

  private Map<String, String> getBaseInfoByDomianAndIp(String domain, String ip) {
    Map<String, String> data = new HashMap<String, String>();

    TransactionReport transactionReport = getTransactionHourlyReport(domain, ip, null);

    if (transactionReport == null) {
      return data;
    }
    Machine transactionMachine = transactionReport.getMachines().get(ip);
    if (transactionMachine != null) {
      Collection<TransactionType> types = transactionMachine.getTypes().values();
      for (TransactionType type : types) {
        String name = type.getId();
        data.put(name + TIME, m_format.format(type.getAvg()));
View Full Code Here

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

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

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

      String name = payload.getName();
      String ip = payload.getIp();

      if (!StringUtils.isEmpty(report)) {
        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);
View Full Code Here

  public Set<String> getDomains() {
    return m_reportManager.getDomains(getStartTime());
  }

  public TransactionReport getRawReport(String domain) {
    TransactionReport report = m_reportManager.getHourlyReport(getStartTime(), domain, false);

    return report;
  }
View Full Code Here

        try {
          return queryReport(domain);
          // for concurrent modify exception
        } catch (ConcurrentModificationException ce) {
          Cat.logEvent("ConcurrentModificationException", domain, Event.SUCCESS, null);
          return new TransactionReport(domain);
        }
      }
    } else {
      Map<String, TransactionReport> reports = m_reportManager.getHourlyReports(getStartTime());
View Full Code Here

  }

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

    report.addIp(tree.getIpAddress());

    if (message instanceof Transaction) {
      Transaction root = (Transaction) message;

      processTransaction(report, tree, root);
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.transaction.model.entity.TransactionReport

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.