Package org.shiftone.jrat.provider.tree.ui

Examples of org.shiftone.jrat.provider.tree.ui.StackTreeNode


  public int getMaxEffectiveDepth(StackTreeNode node) {

    int maxChildDepth = 0;
    for (int i = 0; i < node.getChildCount(); i++) {
      StackTreeNode child = (StackTreeNode) node.getChildAt(i);
      if (child.getTotalDurationNanos() > 0) {
        maxChildDepth = Math.max(maxChildDepth, getMaxEffectiveDepth(child));
      }
    }
    return 1 + maxChildDepth;
  }
View Full Code Here


    long totalDegrees = max - min;
    long totalNanos = node.getTotalDurationNanos();
    if ((totalNanos > 0) && (node.getChildCount() > 0)) {
      int startDegrees = min;
      for (int i = 0; i < node.getChildCount(); i++) {
        StackTreeNode child = (StackTreeNode) node.getChildAt(i);
        long partNanos = child.getTotalDurationNanos();
        int partDegrees = (int) ((partNanos * totalDegrees) / totalNanos);
        if (partDegrees > 1) {
          paintNode(g,
              child,
              x,
View Full Code Here

    // print the children
    long total = node.getTotalDurationNanos();
    if ((total > 0) && (node.getChildCount() > 0)) {
      int childX = 0;
      for (int i = 0; i < node.getChildCount(); i++) {
        StackTreeNode child = (StackTreeNode) node.getChildAt(i);
        long part = child.getTotalDurationNanos();
        int partWidth = (int) ((part * (long) width) / total);
        if (partWidth > 1) {
          paint(g, child, x + childX, row + 1, partWidth);
        } else {
          g.setColor(LINE_COLOR);
View Full Code Here

  }

  public void actionPerformed(ActionEvent e) {

    TreePath treePath = treePopupMouseAdaptor.getTreePath();
    StackTreeNode nodeModel = (StackTreeNode) treePath.getLastPathComponent();
    Map map = new HashMap();
    populateTable(nodeModel, map);
    try {
      StatsViewerPanel statsViewerPanel = new StatsViewerPanel(map.values());
      //
      String newViewTitle;
      if (nodeModel.isRootNode()) {
        newViewTitle = view.getTitle() + " : Flattened View";
      } else {
        newViewTitle = view.getTitle() + " : " + nodeModel.getMethodKey().toString() + " : Flattened View";
      }
      View newView = view.getContainer().createView(newViewTitle);
      newView.setBody(statsViewerPanel);
    } catch (Exception x) {
      x.printStackTrace();
View Full Code Here

  }

  public void actionPerformed(ActionEvent e) {

    TreePath treePath = treePopupMouseAdaptor.getTreePath();
    StackTreeNode nodeModel = (StackTreeNode) treePath.getLastPathComponent();
    String newViewTitle;
    if (nodeModel.isRootNode()) {
      newViewTitle = view.getTitle() + " : Root Node";
    } else {
      newViewTitle = view.getTitle() + " : " + nodeModel.getMethodKey().toString();
    }
    View newView = view.getContainer().createView(newViewTitle);
    TreeViewerPanel treeViewerPanel = new TreeViewerPanel(nodeModel, newView);
    newView.setBody(treeViewerPanel);
  }
View Full Code Here

    tgPanel.addNode(node);


    for (int i = 0; i < treeNode.getChildCount(); i++) {

      StackTreeNode child = (StackTreeNode) treeNode.getChildAt(i);
      Color edgeColor = colorLookup.getColor(child.getPctOfAvgParentDuration());
      Node childNode = buildTouchGraphTree(child, depth + 1);
      CallEdge edge = new CallEdge(node, childNode, edgeColor);
      tgPanel.addEdge(edge);

    }
View Full Code Here

  public void actionPerformed(ActionEvent e) {

    TreePath treePath = treePopupMouseAdaptor.getTreePath();
    LOG.info("actionPerformed " + treePath);
    StackTreeNode nodeModel = (StackTreeNode) treePath.getLastPathComponent();
    if (nodeModel.isRootNode()) {
      return; // todo
    }
    try {
      Assert.assertNotNull("nodeModel", nodeModel);
      new Thread(new BuildGraphRunnable(nodeModel, nodeModel.getMethodKey().toString())).start();
    } catch (Exception x) {
      LOG.error("error launching touchgraph", x);
    }
  }
View Full Code Here

    List newChildren = new ArrayList();
    newChildren.add(node);
    int childrenTotalDurationNanos = 0;
    for (int i = 0; i < node.getChildCount(); i++) {
      StackTreeNode child = (StackTreeNode) node.getChildAt(i);
      childrenTotalDurationNanos += child.getTotalDurationNanos();
      newChildren.add(child);
    }
    children = newChildren;
    if (node.getTotalDurationNanos() == 0) {
      parentTotalDurationPercent = null;
View Full Code Here

    return false;
  }

  public Object getValueAt(int rowIndex, int columnIndex) {

    StackTreeNode node = (StackTreeNode) children.get(rowIndex);
    MethodKey methodKey = node.getMethodKey();
    if (methodKey == null) {
      return "?";
    }
    switch (columnIndex) {
    case 0:
      return methodKey.getClassName();
    case 1:
      return methodKey.getMethodName();
    case 2:
      return methodKey.getPrettySignature();
    case 3:
      return new Long(node.getTotalEnters());
    case 4:
      return new Long(node.getTotalExits());
    case 5:
      return new Long(node.getTotalErrors());
    case 6:
      return new Integer(node.getMaxConcurrentThreads());
    case 7:
      return new Long(node.getTotalDuration(TimeUnit.MS));
    case 8:
      return node.getAverageDuration(TimeUnit.MS);
    case 9:
      return node.getStdDeviation();
    case 10:
      return node.getMinDuration(TimeUnit.MS);
    case 11:
      return node.getMaxDuration(TimeUnit.MS);
    case 12:
      return (rowIndex == 0) ? parentTotalDurationPercent : new Percent(node.getPctOfAvgParentDuration());
    }
    return null;
  }
View Full Code Here

      Percent.class, Percent.class };

  public synchronized void setStackTreeNode(StackTreeNode root, StackTreeNode node) {

    List newStack = new ArrayList();
    StackTreeNode currNode = node;
    while (currNode.getParent() != null) {
      newStack.add(currNode);
      if (currNode == root) {
        break;
      }
      currNode = (StackTreeNode) currNode.getParentNode();
    }
    // -------------------------------------
    // I'm calcing the %of root on the fly - which allows any node to be
    // set as the root node of the view. To do that, I need to know the
    // total
    // duration of the effective root. aka the last node on the stack.
    // this is different from "root" because the that object may be the
    // fake base node.
    if (newStack.isEmpty()) {
      rootTotalDuration = 0;
    } else {
      StackTreeNode viewRoot = (StackTreeNode) newStack.get(newStack.size() - 1);
      rootTotalDuration = viewRoot.getTotalDurationNanos();
    }
    stack = newStack;
    fireTableDataChanged();
  }
View Full Code Here

TOP

Related Classes of org.shiftone.jrat.provider.tree.ui.StackTreeNode

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.