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

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


      graph.setDomain(reportDomain);
      graph.setName(reportName);
      graph.setPeriod(reportPeriod);
      graph.setType(3);
      graph.setCreationDate(creationDate);
      Machine machine = report.findOrCreateMachine(ip);
      Map<String, TransactionType> types = machine.getTypes();
      StringBuilder detailBuilder = new StringBuilder();
      StringBuilder summaryBuilder = new StringBuilder();
      for (Entry<String, TransactionType> transactionEntry : types.entrySet()) {
        TransactionType transactionType = transactionEntry.getValue();
        long[] typeCounts = new long[60];
View Full Code Here


    }
  }

  @Override
  public void visitName(TransactionName name) {
    Machine machine = m_report.findOrCreateMachine(m_currentDomain);
    TransactionType curentType = machine.findOrCreateType(m_currentType);
    TransactionName currentName = curentType.findOrCreateName(name.getId());
   
    mergeName(currentName, name);
  }
View Full Code Here

    super.visitTransactionReport(transactionReport);
  }

  @Override
  public void visitType(TransactionType type) {
    Machine machine = m_report.findOrCreateMachine(m_currentDomain);
    String typeName = type.getId();
    TransactionType result = machine.findOrCreateType(typeName);

    m_currentType = typeName;
    mergeType(result, type);

    if (typeName.startsWith("Cache.")) {
View Full Code Here

      old.setAvg(old.getSum() / old.getCount());
    }
  }

  public Machine mergesForAllMachine(TransactionReport report) {
    Machine all = new Machine(Constants.ALL);

    for (Machine m : report.getMachines().values()) {
      if (!m.getIp().equals(Constants.ALL)) {
        visitMachineChildren(all, m);
      }
View Full Code Here

    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()));
        data.put(name + COUNT, m_format.format(type.getTotalCount()));
      }
View Full Code Here

    }
  }

  private void buildTransactionReportResult(TransactionReport transactionReport, String ip, String type, String name,
        Map<String, String> data) {
    Machine transactionMachine = transactionReport.getMachines().get(ip);
    if (transactionMachine != null) {
      if (StringUtils.isEmpty(name) && StringUtils.isEmpty(type)) {
        Collection<TransactionType> types = transactionMachine.getTypes().values();

        for (TransactionType transactionType : types) {
          String id = transactionType.getId();

          data.put(id + TIME, m_format.format(transactionType.getAvg()));
          data.put(id + COUNT, String.valueOf(transactionType.getTotalCount()));
          data.put(id + FAILURE_COUNT, String.valueOf(transactionType.getFailCount()));
        }
      } else if (StringUtils.isEmpty(name) && !StringUtils.isEmpty(type)) {
        TransactionType transactionType = transactionMachine.findType(type);

        if (transactionType != null) {
          data.put(TIME, m_format.format(transactionType.getAvg()));
          data.put(COUNT, String.valueOf(transactionType.getTotalCount()));
          data.put(FAILURE_COUNT, String.valueOf(transactionType.getFailCount()));

          for (TransactionName transactionName : transactionType.getNames().values()) {
            String id = transactionName.getId();
            data.put(id + TIME, m_format.format(transactionName.getAvg()));
            data.put(id + COUNT, String.valueOf(transactionName.getTotalCount()));
            data.put(id + FAILURE_COUNT, String.valueOf(transactionName.getFailCount()));
          }
        }
      } else if (!StringUtils.isEmpty(name) && !StringUtils.isEmpty(type)) {
        TransactionType transactionType = transactionMachine.findType(type);

        if (transactionType != null) {
          TransactionName transactionName = transactionType.findName(name);

          if (transactionName != null) {
View Full Code Here

  private Set<String> m_ips = new HashSet<String>();

  private List<TransactionTypeModel> m_results = new ArrayList<TransactionTypeModel>();

  public DisplayTypes display(String sorted, String ip, TransactionReport report) {
    Machine machine = report.getMachines().get(ip);
    if (machine == null) {
      return this;
    }
    m_ips = report.getIps();

    Map<String, TransactionType> types = machine.getTypes();
    if (types != null) {
      for (Entry<String, TransactionType> entry : types.entrySet()) {
        m_results.add(new TransactionTypeModel(entry.getKey(), entry.getValue()));
      }
    }
View Full Code Here

TOP

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

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.