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

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


        long[] typeFails = new long[60];
        double[] typeSums = new double[60];

        Map<String, TransactionName> names = transactionType.getNames();
        for (Entry<String, TransactionName> nameEntry : names.entrySet()) {
          TransactionName transactionName = nameEntry.getValue();
          List<Range> ranges = new ArrayList<Range>(transactionName.getRanges().values());

          detailBuilder.append(transactionType.getId());
          detailBuilder.append('\t');
          detailBuilder.append(transactionName.getId());
          detailBuilder.append('\t');
          long[] totalCount = getTotalCount(ranges);
          detailBuilder.append(arrayToString(totalCount));
          detailBuilder.append('\t');
          long[] failsCount = getFailsCount(ranges);
          detailBuilder.append(arrayToString(failsCount));
          detailBuilder.append('\t');
          detailBuilder.append(transactionName.getMin());
          detailBuilder.append('\t');
          detailBuilder.append(transactionName.getMax());
          detailBuilder.append('\t');
          double[] sumCount = getSumCount(ranges);
          detailBuilder.append(arrayToString(sumCount));
          detailBuilder.append('\t');
          detailBuilder.append(transactionName.getSum2());
          detailBuilder.append('\n');

          String key = transactionType.getId() + "\t" + transactionName.getId();
          GraphLine detailLine = allDetailCache.get(key);
          if (detailLine == null) {
            detailLine = new GraphLine();
            allDetailCache.put(key, detailLine);
          }

          detailLine.totalCounts = arrayAdd(detailLine.totalCounts, totalCount);
          detailLine.failCounts = arrayAdd(detailLine.failCounts, failsCount);
          detailLine.min += transactionName.getMin();
          detailLine.max += transactionName.getMax();
          detailLine.sums = arrayAdd(detailLine.sums, sumCount);
          detailLine.sum2 += transactionName.getSum2();

          typeCounts = arrayAdd(typeCounts, totalCount);
          typeFails = arrayAdd(typeFails, failsCount);
          typeSums = arrayAdd(typeSums, sumCount);
        }
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

        }
      } else if (!StringUtils.isEmpty(name) && !StringUtils.isEmpty(type)) {
        TransactionType transactionType = transactionMachine.findType(type);

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

          if (transactionName != null) {
            data.put(TIME, m_format.format(transactionName.getAvg()));
            data.put(COUNT, String.valueOf(transactionName.getTotalCount()));
            data.put(FAILURE_COUNT, String.valueOf(transactionName.getFailCount()));
          }
        }
      }
    }
  }
View Full Code Here

      Pair<Boolean, Long> pair = checkForTruncatedMessage(tree, t);

      if (pair.getKey().booleanValue()) {
        String ip = tree.getIpAddress();
        TransactionType type = report.findOrCreateMachine(ip).findOrCreateType(t.getType());
        TransactionName name = type.findOrCreateName(t.getName());
        String messageId = tree.getMessageId();
       
        processTypeAndName(t, type, name, messageId, pair.getValue().doubleValue() / 1000d);
      }
View Full Code Here

      for (int i = 0; i < m_maxItems; i++) {
        type.addName(all.get(i));
      }

      TransactionName other = type.findOrCreateName("OTHERS");

      for (int i = m_maxItems; i < size; i++) {
        mergeName(other, all.get(i));
      }

      List<String> toRemove = new ArrayList<String>();

      transactionNames = type.getNames();
      for (Entry<String, TransactionName> entry : type.getNames().entrySet()) {
        TransactionName tansactionName = entry.getValue();

        if (tansactionName.getTotalCount() == 1) {
          toRemove.add(entry.getKey());
          mergeName(other, tansactionName);
        }
      }
View Full Code Here

    }
  }

  private void buildTransactionNameGraph(Model model, TransactionReport report, String type, String name, String ip) {
    TransactionType t = report.findOrCreateMachine(ip).findOrCreateType(type);
    TransactionName transactionName = t.findOrCreateName(name);
    transformTo60MinuteData(transactionName);

    if (transactionName != null) {
      String graph1 = m_builder.build(new DurationPayload("Duration Distribution", "Duration (ms)", "Count",
            transactionName));
View Full Code Here

    List<Item> items = new ArrayList<Item>();

    for (int i = 1; i < names.size(); i++) {
      TransactionNameModel name = names.get(i);
      Item item = new Item();
      TransactionName transaction = name.getDetail();
      item.setNumber(transaction.getTotalCount()).setTitle(transaction.getId());
      items.add(item);
    }

    chart.addItems(items);
    model.setPieChart(new JsonBuilder().toJson(chart));
View Full Code Here

    CacheNameItem item = m_nameItems.get(categroy);
    CacheNameItem all = m_nameItems.get(ALL);

    if (all == null) {
      all = new CacheNameItem();
      all.setName(new TransactionName(ALL));
      m_nameItems.put(ALL, all);
    }
    all.add(transactionName, eventName, method);

    if (item == null) {
      item = new CacheNameItem();
      item.setName(new TransactionName(categroy));
      m_nameItems.put(categroy, item);
    }
    item.add(transactionName, eventName, method);
  }
View Full Code Here

  }

  @Override
  public void visitName(TransactionName name) {
    m_currentName = name.getId();
    TransactionName temp = m_report.findOrCreateMachine(m_currentIp).findOrCreateType(m_currentType)
          .findOrCreateName(m_currentName);

    m_merger.mergeName(temp, name);

    TransactionName all = m_report.findOrCreateMachine(m_currentIp).findOrCreateType(m_currentType)
          .findOrCreateName(Constants.ALL);
    m_merger.mergeName(all, name);

    m_merger.mergeName(temp, name);
    super.visitName(name);
View Full Code Here

  }

  @Override
  public void visitName(TransactionName name) {
    m_currentName = name.getId();
    TransactionName temp = m_report.findOrCreateMachine(Constants.ALL).findOrCreateType(m_currentType)
          .findOrCreateName(m_currentName);

    m_merger.mergeName(temp, name);
    super.visitName(name);
  }
View Full Code Here

TOP

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

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.