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

Examples of com.dianping.cat.consumer.matrix.model.entity.Matrix


      List<Matrix> matrixList = new ArrayList<Matrix>(matrix);
      Collections.sort(matrixList, new MeatricCompartor());

      matrixs.clear();
      for (int i = 0; i < m_maxSize; i++) {
        Matrix temp = matrixList.get(i);
        matrixs.put(temp.getName(), temp);
      }

      Matrix value = new Matrix(OTHERS);
      for (int i = m_maxSize; i < size; i++) {
        Matrix item = matrixList.get(i);

        value.setType(item.getType());
        value.setCount(item.getCount() + value.getCount());
      }
      matrixs.put(OTHERS, value);
    }

    super.visitMatrixReport(matrixReport);
View Full Code Here


      if (m_serverConfigManager.discardTransaction((Transaction) message)) {
        return;
      }
      if (messageType.equals("URL") || messageType.equals("Service") || messageType.equals("PigeonService")) {
        Matrix matrix = report.findOrCreateMatrix(message.getName());
        matrix.setType(message.getType());
        matrix.setName(message.getName());
        long duration = ((Transaction) message).getDurationInMicros();
        matrix.incCount();
        matrix.setTotalTime(matrix.getTotalTime() + duration);

        Map<String, Ratio> ratios = new HashMap<String, Ratio>();
        ratios.put("Call", new Ratio());
        ratios.put("SQL", new Ratio());
        ratios.put("Cache", new Ratio());

        processTransaction(tree, (Transaction) message, ratios);

        for (Entry<String, Ratio> entry : ratios.entrySet()) {
          String type = entry.getKey();
          Ratio ratio = entry.getValue();
          int count = ratio.getTotalCount();
          long time = ratio.getTotalTime();

          Ratio real = matrix.findOrCreateRatio(type);
          if (real.getMin() > count || real.getMin() == 0) {
            real.setMin(count);
          }
          if (real.getMax() < count) {
            real.setMax(count);
            real.setUrl(tree.getMessageId());
          }
          real.setTotalCount(real.getTotalCount() + count);
          real.setTotalTime(real.getTotalTime() + time);
        }
        if (matrix.getUrl() == null) {
          matrix.setUrl(tree.getMessageId());
        }
      }
    }
  }
View Full Code Here

TOP

Related Classes of com.dianping.cat.consumer.matrix.model.entity.Matrix

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.