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

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


  public DisplayNames() {
  }

  public DisplayNames display(String sorted, String type, String ip, TransactionReport report, String queryName) {
    Map<String, TransactionType> types = report.findOrCreateMachine(ip).getTypes();
    TransactionName all = new TransactionName("TOTAL");
    all.setTotalPercent(1);
    if (types != null) {
      TransactionType names = types.get(type);

      if (names != null) {
        for (Entry<String, TransactionName> entry : names.getNames().entrySet()) {
          String transTypeName = entry.getValue().getId();
          boolean isAdd = (queryName == null || queryName.length() == 0 || isFit(queryName, transTypeName));
          if (isAdd) {
            m_results.add(new TransactionNameModel(entry.getKey(), entry.getValue()));
            mergeName(all, entry.getValue());
          }
        }
      }
    }
    if (sorted == null) {
      sorted = "avg";
    }
    Collections.sort(m_results, new TransactionNameComparator(sorted));

    long total = all.getTotalCount();
    for (TransactionNameModel nameModel : m_results) {
      TransactionName transactionName = nameModel.getDetail();
      transactionName.setTotalPercent(transactionName.getTotalCount() / (double) total);
    }
    m_results.add(0, new TransactionNameModel("TOTAL", all));
    return this;
  }
View Full Code Here


    TransactionReport report = DefaultSaxParser.parse(source);

    TransactionType type = report.findMachine("10.1.77.193").findType("URL");

    for (int i = 0; i < 3500; i++) {
      type.addName(new TransactionName("Test" + i));
    }

    TransactionReportCountFilter f1 = new TransactionReportCountFilter();
    String filterReport = f1.buildXml(report);
    TransactionReport newReport = DefaultSaxParser.parse(filterReport);
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.