Package org.jboss.profiler.graphmodel

Examples of org.jboss.profiler.graphmodel.GraphMethod


      Iterator iter = callings.getMethods().iterator();

      HashMap hashMethods = new HashMap();

      while (iter.hasNext()) {
        GraphMethod graphmethod = (GraphMethod) iter.next();

        if (graphmethod.getLevel() != currentLevel) {
          currentLevel = graphmethod.getLevel();
          currentCell = 0;
        } else {
          currentCell++;
        }

        DefaultGraphCell graphcell = new DefaultGraphCell(graphmethod);
        graphcell.add(new DefaultPort("port/Center"));
        graphcell.add(new DefaultPort("port/Left"));
        Color color = null;
        switch (currentCell) {
          case 0 :
            color = Color.red;
            break;
          case 1 :
            color = Color.yellow;
            break;
          default :
            color = Color.blue;
            break;
        }
        attributes.put(
          graphcell,
          createBounds(currentLevel, currentCell, color));
        elements[currentElement++] = graphcell;
        hashMethods.put(graphmethod, graphcell);
      }

      Map simpleArrow = GraphConstants.createMap();
      GraphConstants.setLineEnd(
        simpleArrow,
        GraphConstants.ARROW_CLASSIC);
      GraphConstants.setBeginSize(simpleArrow, 10);
      GraphConstants.setDashPattern(simpleArrow, new float[] { 3, 3 });
      GraphConstants.setFont(
        simpleArrow,
        GraphConstants.defaultFont.deriveFont(10));

      GraphMethod key = new GraphMethod();

      iter = callings.getReferences().iterator();
      while (iter.hasNext()) {
        GraphReference referenceCalling = (GraphReference) iter.next();

        key.setMethodId(referenceCalling.getMethodCallee());
        key.setLevel(referenceCalling.getLevelCallee());
        DefaultGraphCell cellcallee =
          (DefaultGraphCell) hashMethods.get(key);

        key.setMethodId(referenceCalling.getMethodCalled());
        key.setLevel(referenceCalling.getLevelCalled());
        DefaultGraphCell cellcalled =
          (DefaultGraphCell) hashMethods.get(key);

                if (cellcallee!=null && cellcalled!=null) {
          DefaultEdge relationship =
View Full Code Here


      if (ev.getClickCount() == 2) {
        Object obj =
          jgraph.getFirstCellForLocation(ev.getX(), ev.getY());
        if (obj != null && obj instanceof DefaultGraphCell) {
          DefaultGraphCell graphCell = (DefaultGraphCell) obj;
          GraphMethod graphMethod =
            (GraphMethod) graphCell.getUserObject();
          java.net.URL urlNavigate =
            new java.net.URL(
              this.getCodeBase().toString()
                + "methodCriticalPath.jsp"
                + graphMethod.getUrl());
          this.getAppletContext().showDocument(urlNavigate);
        }
      } else {
        Object obj =
          jgraph.getFirstCellForLocation(ev.getX(), ev.getY());
        if (obj != null && obj instanceof DefaultGraphCell) {
          DefaultGraphCell graphCell = (DefaultGraphCell) obj;
          GraphMethod graphMethod =
            (GraphMethod) graphCell.getUserObject();
        }
      }
    } catch (Exception ex) {
      ex.printStackTrace();
View Full Code Here

      Iterator iter = callings.getMethods().iterator();

      HashMap hashMethods = new HashMap();

      while (iter.hasNext()) {
        GraphMethod graphmethod = (GraphMethod) iter.next();

        if (graphmethod.getLevel() != currentLevel) {
          currentLevel = graphmethod.getLevel();
          currentCell = 0;
        } else {
          currentCell++;
        }

        DefaultGraphCell graphcell = new DefaultGraphCell(graphmethod);
        graphcell.add(new DefaultPort("port/Center"));
        graphcell.add(new DefaultPort("port/Left"));
        Color color = null;
        switch (currentCell) {
          case 0 :
            color = Color.red;
            break;
          case 1 :
            color = Color.yellow;
            break;
          default :
            color = Color.blue;
            break;
        }
        attributes.put(
          graphcell,
          createBounds(currentLevel, currentCell, color));
        elements[currentElement++] = graphcell;
        hashMethods.put(graphmethod, graphcell);
      }

      Map simpleArrow = GraphConstants.createMap();
      GraphConstants.setLineEnd(
        simpleArrow,
        GraphConstants.ARROW_CLASSIC);
      GraphConstants.setBeginSize(simpleArrow, 10);
      GraphConstants.setDashPattern(simpleArrow, new float[] { 3, 3 });
      GraphConstants.setFont(
        simpleArrow,
        GraphConstants.defaultFont.deriveFont(10));

      GraphMethod key = new GraphMethod();

      iter = callings.getReferences().iterator();
      while (iter.hasNext()) {
        GraphReference referenceCalling = (GraphReference) iter.next();

        key.setMethodId(referenceCalling.getMethodCallee());
        key.setLevel(referenceCalling.getLevelCallee());
        DefaultGraphCell cellcallee =
          (DefaultGraphCell) hashMethods.get(key);

        key.setMethodId(referenceCalling.getMethodCalled());
        key.setLevel(referenceCalling.getLevelCalled());
        DefaultGraphCell cellcalled =
          (DefaultGraphCell) hashMethods.get(key);

        DefaultEdge relationship =
          new DefaultEdge(
View Full Code Here

      if (ev.getClickCount() == 2) {
        Object obj =
          jgraph.getFirstCellForLocation(ev.getX(), ev.getY());
        if (obj != null && obj instanceof DefaultGraphCell) {
          DefaultGraphCell graphCell = (DefaultGraphCell) obj;
          GraphMethod graphMethod =
            (GraphMethod) graphCell.getUserObject();
          java.net.URL urlNavigate =
            new java.net.URL(
              this.getCodeBase().toString()
                + "instancesStackGraph.jsp"
                + graphMethod.getUrl());
          this.getAppletContext().showDocument(urlNavigate);
        }
      } else {
        Object obj =
          jgraph.getFirstCellForLocation(ev.getX(), ev.getY());
        if (obj != null && obj instanceof DefaultGraphCell) {
          DefaultGraphCell graphCell = (DefaultGraphCell) obj;
          GraphMethod graphMethod =
            (GraphMethod) graphCell.getUserObject();
        }
      }
    } catch (Exception ex) {
      ex.printStackTrace();
View Full Code Here

        int level = 0;
        // root
        if (numberOfPaths == 0) {
            oldMethod = consolidacao.getSpyMethod().getMethodID();
            GraphMethod newMethod = new GraphMethod((JBPMethod) spyMethods
                    .get(consolidacao.getSpyMethod()), level++, createURL(
                    rootMethod, null, null));
            hashMethods.put(newMethod, newMethod);
        }

        GraphMethod methodKey = new GraphMethod();

        for (int i = 0; i < numberOfPaths; i++) {
            consolidacao = consolidacao.getCalledCount(path[i]);

            if (i >= (numberOfPaths - 1)) {
                methodKey.setMethodId(path[i].getMethodID());
                methodKey.setLevel(level++);

                //Long methodKey = new Long(path[i].getMethodID());
                GraphMethod calledGraphMethod = (GraphMethod) hashMethods
                        .get(methodKey);

                if (calledGraphMethod == null) {
                    calledGraphMethod = new GraphMethod((JBPMethod) spyMethods
                            .get(path[i]), level++, createURL(rootMethod,
                            stack, path[i]));
                    hashMethods.put(calledGraphMethod, calledGraphMethod);
                }
View Full Code Here

    private void generateCallingsRecursive(int level, long methodIdCallee,
            JBPMethod rootMethod, JBPMethodCount consolidacao,
            HashMap hashMethods, HashMap hashCallings,
            GraphReference referenceKey, java.util.Stack path) {

        GraphMethod keyMethod = new GraphMethod();
        Iterator iterValues = consolidacao.getCountCalleds().values()
                .iterator();
        while (iterValues.hasNext()) {
            JBPMethodCount subConsolidacao = (JBPMethodCount) iterValues.next();

            double percenptual = ((double) subConsolidacao
                    .getTotalElapsedClock() / (double) rootMethod
                    .getTotalElapsedClock())
                    * (double) 100;
            if (percenptual < 1.00)
                continue;

            keyMethod.setMethodId(subConsolidacao.getSpyMethod().getMethodID());
            keyMethod.setLevel(level);

            if (hashMethods.get(keyMethod) == null) {
                GraphMethod newMethod = new GraphMethod(subConsolidacao
                        .getSpyMethod(), level, createURL(rootMethod, path,
                        subConsolidacao.getSpyMethod()));
                hashMethods.put(newMethod, newMethod);
            }
        }

        iterValues = consolidacao.getCountCalleds().values().iterator();
        while (iterValues.hasNext()) {
            JBPMethodCount subConsolidacao = (JBPMethodCount) iterValues.next();

            keyMethod.setMethodId(subConsolidacao.getSpyMethod().getMethodID());
            keyMethod.setLevel(level);
            GraphMethod graphMethod = (GraphMethod) hashMethods.get(keyMethod);

            double percenptual = ((double) subConsolidacao
                    .getTotalElapsedClock() / (double) rootMethod
                    .getTotalElapsedClock())
                    * (double) 100;
            if (percenptual < 1.00)
                continue;

            if (graphMethod == null) {
                throw new RuntimeException("Unexpected null method");
            }

            referenceKey.setMethodCallee(methodIdCallee);
            referenceKey.setLevelCallee(level - 1);
            referenceKey.setLevelCalled(level);
            referenceKey.setMethodCalled(subConsolidacao.getSpyMethod()
                    .getMethodID());
            if (hashCallings.get(referenceKey) == null) {
                GraphReference ref = new GraphReference(level - 1,
                        methodIdCallee, level, subConsolidacao.getSpyMethod()
                                .getMethodID(), ((double) subConsolidacao
                                .getTotalElapsedClock() / (double) rootMethod
                                .getTotalElapsedClock())
                                * (double) 100, (double) subConsolidacao
                                .getTotalClocks()
                                / (double) rootMethod.getTotalClock()
                                * (double) 100);
                graphMethod.setWeight(graphMethod.getWeight() + percenptual);
                hashCallings.put(ref, ref);
            }

            path.push(subConsolidacao.getSpyMethod());
            generateCallingsRecursive(level + 1, subConsolidacao.getSpyMethod()
View Full Code Here

        long oldMethod = 0;

        int level = 0;
        // root
        GraphMethod methodKey = new GraphMethod();


        JBPMethod methodConsolidado = consolidacao.getSpyMethod();
        methodConsolidado = (JBPMethod) spyMethods.get(methodConsolidado);
View Full Code Here

    private static void generateCallingsRecursive(int level, long methodIdCallee,
            JBPMethod rootMethod, JBPMethodCount consolidation,
            HashMap hashMethods, HashMap hashCallings,
            GraphReference referenceKey) {

        GraphMethod keyMethod = new GraphMethod();
        Iterator iterValues = consolidation.getCountCalleds().values()
                .iterator();
        while (iterValues.hasNext()) {
            JBPMethodCount subConsolidacao = (JBPMethodCount) iterValues.next();

            double percenptual = ((double) subConsolidacao
                    .getTotalElapsedClock() / (double) rootMethod
                    .getTotalElapsedClock())
                    * (double) 100;
            if (percenptual < 1.00)
                continue;

            keyMethod.setMethodId(subConsolidacao.getSpyMethod().getMethodID());
            keyMethod.setLevel(level);

            if (hashMethods.get(keyMethod) == null) {
                GraphMethod newMethod = new GraphMethod(subConsolidacao
                        .getSpyMethod(), level, DEFAULT_URL);
                hashMethods.put(newMethod, newMethod);
            }
        }

        iterValues = consolidation.getCountCalleds().values().iterator();
        while (iterValues.hasNext()) {
            JBPMethodCount subConsolidacao = (JBPMethodCount) iterValues.next();

            keyMethod.setMethodId(subConsolidacao.getSpyMethod().getMethodID());
            keyMethod.setLevel(level);
            GraphMethod graphMethod = (GraphMethod) hashMethods.get(keyMethod);

            double percenptual = ((double) subConsolidacao
                    .getTotalElapsedClock() / (double) rootMethod
                    .getTotalElapsedClock())
                    * (double) 100;
            if (percenptual < 1.00)
                continue;

            if (graphMethod == null) {
                throw new RuntimeException("Unexpected null method");
            }

            referenceKey.setMethodCallee(methodIdCallee);
            referenceKey.setLevelCallee(level - 1);
            referenceKey.setLevelCalled(level);
            referenceKey.setMethodCalled(subConsolidacao.getSpyMethod()
                    .getMethodID());
            if (hashCallings.get(referenceKey) == null) {
                GraphReference ref = new GraphReference(level - 1,
                        methodIdCallee, level, subConsolidacao.getSpyMethod()
                                .getMethodID(), ((double) subConsolidacao
                                .getTotalElapsedClock() / (double) rootMethod
                                .getTotalElapsedClock())
                                * (double) 100, (double) subConsolidacao
                                .getTotalClocks()
                                / (double) rootMethod.getTotalClock()
                                * (double) 100);
                graphMethod.setWeight(graphMethod.getWeight() + percenptual);
                hashCallings.put(ref, ref);
            }

            generateCallingsRecursive(level + 1, subConsolidacao.getSpyMethod()
                    .getMethodID(), rootMethod, subConsolidacao, hashMethods,
View Full Code Here

TOP

Related Classes of org.jboss.profiler.graphmodel.GraphMethod

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.