Package org.shiftone.jrat.core

Examples of org.shiftone.jrat.core.MethodKey


    String result;
    if (treeNode.isRootNode()) {
      result = "Root";
    } else {
      MethodKey methodKey = treeNode.getMethodKey();
      String methodName = methodKey.getMethodName();
      if (treeNode.isChildOfRootNode()) {
        Float avg = treeNode.getAverageDurationNanos();
        result = methodName
            + ((avg == null) ? " - never exited"
                : (" - " + msDecimalFormat.format(treeNode.getAverageDuration(TimeUnit.MS))));
View Full Code Here


    g.setColor(color);
    g.fill3DRect(x, y, width, height, true);
    // print the text on the node
    Graphics gg = g.create(x, y, width, height);
    gg.setColor(Color.BLACK);
    MethodKey methodKey = node.getMethodKey();
    String text = methodKey.getClassName() + "." + methodKey.getMethodName() + " "
        + pctDecimalFormat.format(node.getPctOfAvgRootDuration());
    Rectangle2D stringBounds = metrics.getStringBounds(text, g);
    if (stringBounds.getWidth() < width) {
      gg.drawString(text, (int) (width / 2 - stringBounds.getWidth() / 2), (int) (stringBounds.getHeight()));
    } else {
      text = methodKey.getMethodName() + " " + pctDecimalFormat.format(node.getPctOfAvgParentDuration());
      stringBounds = metrics.getStringBounds(text, g);
      if (stringBounds.getWidth() < width) {
        gg.drawString(text, (int) (width / 2 - stringBounds.getWidth() / 2), (int) (stringBounds.getHeight()));
      }
    }
View Full Code Here

  public void populateTable(StackTreeNode nodeModel, Map map) {

    if (!nodeModel.isRootNode()) {
      //
      MethodKey methodKey = nodeModel.getMethodKey();
      MethodKeyAccumulator accumulator = (MethodKeyAccumulator) map.get(methodKey);
      if (accumulator == null) {
        accumulator = new MethodKeyAccumulator(methodKey);
        map.put(methodKey, accumulator);
      }
View Full Code Here

  private StackTreeNode currentNode = root;

  public void startElement(String qName, Properties atts) throws Exception {

    if ("call".equals(qName)) {
      MethodKey methodKey = new MethodKey(atts.getProperty("c"), atts.getProperty("m"), atts.getProperty("s"));
      currentNode = (StackTreeNode) currentNode.getChild(methodKey);
      String minString = atts.getProperty("min");
      String maxString = atts.getProperty("max");
      long min = (minString != null) ? Long.parseLong(minString) : 0;
      long max = (maxString != null) ? Long.parseLong(maxString) : 0;
View Full Code Here

  }

  private Node buildTouchGraphTree(StackTreeNode treeNode, int depth) throws TGException {

    Assert.assertNotNull("treeNode", treeNode);
    MethodKey methodKey = treeNode.getMethodKey();
    String title = (methodKey == null) ? "Root" : methodKey.getMethodName(); // + "
                                          // - "
                                          // +
                                          // treeNode.getAverageDuration(TimeUnit.MS)
                                          // +
                                          // "ms";
View Full Code Here

    // 0 METHOD, 1 index, 2 class, 3 method, 4 signature 5 END
    if (tokens.length != 6) {
      throw new ParseException("error in format of method key : " + tokens);
    }
    methodKeys.add(Integer.parseInt(tokens[1]), new MethodKey(tokens[2], tokens[3], tokens[4]));
  }
View Full Code Here

  /**
   * Method getValueAt
   */
  public Object getValueAt(int rowIndex, int columnIndex) {

    MethodKey methodKey = rateModel.getMethodKey(rowIndex);
    Color color = rateModel.getMethodColor(rowIndex);
    Object obj = null;
    switch (columnIndex) {
    case 0:
      obj = methodKey;
View Full Code Here

    return COLUMN_NAMES[i];
  }

  public Object getColumnValue(Object object, int columnIndex) {

    MethodKey methodKey = (MethodKey) object;
    if (methodKey == null) {
      return null;
    }
    switch (columnIndex) {
    case 0:
      return methodKey.getClassName();
    case 1:
      return methodKey.getMethodName();
    case 2:
      return methodKey.getSig().getLongText();
    case 3:
      return methodKey.getSig().getReturnType();
    }
    throw new IllegalStateException();
  }
View Full Code Here

      icon = ICON_ROOT;
    } else {
      icon = ICON_METHOD;
    }
    setIcon(icon);
    MethodKey methodKey = node.getMethodKey();
    String text;
    if (methodKey == null) {
      text = "";
    } else {
      text = methodKey.getClassName() + "." + methodKey.getMethodName() + methodKey.getPrettySignature() + " - "
          + node.getDurationMs() + "ms";
    }
    setText(text);
    if (selected) {
      setForeground(Color.white);
View Full Code Here

    }
  }

  private void readEnter() throws IOException {

    MethodKey methodName = getMethodKey(in.readInt());
    TraceNode child = new TraceNode(current);
    child.setMethodKey(methodName);
    current.add(child);
    current = child;
  }
View Full Code Here

TOP

Related Classes of org.shiftone.jrat.core.MethodKey

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.