Examples of GraphCallings


Examples of org.jboss.profiler.graphmodel.GraphCallings

      java.net.URL url =
        new java.net.URL(
          this.getCodeBase().toString() + getParameter("url"));
      java.io.InputStream inp = url.openStream();
      java.io.ObjectInputStream obj = new java.io.ObjectInputStream(inp);
      GraphCallings callings = (GraphCallings) obj.readObject();
      callings.printDebug();

      DefaultGraphCell elements[] =
        new DefaultGraphCell[callings.getMethods().size()
          + callings.getReferences().size()];

      int currentLevel = -1;
      int currentCell = -1;
      int currentElement = 0;

      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());
View Full Code Here

Examples of org.jboss.profiler.graphmodel.GraphCallings

      ConnectionSet intersectionSet = new ConnectionSet();

      // Attributes
      java.util.HashMap attributes = new java.util.HashMap();

      GraphCallings callings = readObject();
      callings.printDebug();

      DefaultGraphCell elements[] =
        new DefaultGraphCell[callings.getMethods().size()
          + callings.getReferences().size()];

      int currentLevel = -1;
      int currentCell = -1;
      int currentElement = 0;

      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());
View Full Code Here

Examples of org.jboss.profiler.graphmodel.GraphCallings

    java.net.URL url =
      new java.net.URL(
        this.getCodeBase().toString() + getParameter("url"));
    java.io.InputStream inp = url.openStream();
    java.io.ObjectInputStream obj = new java.io.ObjectInputStream(inp);
    GraphCallings callings = (GraphCallings) obj.readObject();

    return callings;
  }
View Full Code Here

Examples of org.jboss.profiler.graphmodel.GraphCallings

                keyMethod.setMethodID(methodsId[i]);
                metodosPesquisados[i] = (JBPMethod) spyProcess.getSpyMethods()
                        .get(keyMethod);
            }

            GraphCallings graph = generateCallings(spyMethods, consolidacao,
                    spyMethodToCalc, metodosPesquisados);

            java.io.ObjectOutputStream outObj = new java.io.ObjectOutputStream(
                    response.getOutputStream());
            outObj.writeObject(graph);
View Full Code Here

Examples of org.jboss.profiler.graphmodel.GraphCallings

        java.util.Stack stack = new java.util.Stack();

        HashMap hashMethods = new HashMap();
        HashMap hashCallings = new HashMap();
        GraphCallings graph = new GraphCallings();

        // para ajudar na referencia entre chamadas
        GraphReference referenceKey = new GraphReference();

        int numberOfPaths = path.length;

        long oldMethod = 0;

        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);
                }

                if (oldMethod != 0) {
                    referenceKey.setMethodCallee(oldMethod);
                    referenceKey.setMethodCalled(path[i].getMethodID());
                    if (hashCallings.get(referenceKey) == null) {
                        double percenptual = (double) consolidacao
                                .getTotalElapsedClock()
                                / (double) rootMethod.getTotalElapsedClock()
                                * (double) 100;
                        GraphReference ref = new GraphReference(level - 1,
                                oldMethod, level, path[i].getMethodID(),
                                percenptual, (double) consolidacao
                                        .getTotalClocks()
                                        / (double) rootMethod.getTotalClock()
                                        * (double) 100);
                        hashCallings.put(ref, ref);
                    }
                }

                oldMethod = path[i].getMethodID();
            }

            stack.push(path[i]);
        }

        JBPMethod methodConsolidado = consolidacao.getSpyMethod();
        methodConsolidado = (JBPMethod) spyMethods.get(methodConsolidado);

        generateCallingsRecursive(level, oldMethod, rootMethod, consolidacao,
                hashMethods, hashCallings, referenceKey, stack);

        TreeSet treeSet = new TreeSet(new CompareMethods());
        treeSet.addAll(hashMethods.values());

        ArrayList listMethods = new ArrayList();
        listMethods.addAll(treeSet);
        ArrayList listRefs = new ArrayList();
        listRefs.addAll(hashCallings.values());
        graph.setMethods(listMethods);
        graph.setReferences(listRefs);

        graph.printDebug();

        return graph;
    }
View Full Code Here

Examples of org.jboss.profiler.graphmodel.GraphCallings

            Iterator methods = jbpClass.getSpyMethods().values().iterator();
            int count=0;
            while (methods.hasNext()) {
                JBPMethod jbpMethod = (JBPMethod)methods.next();

                GraphCallings graph = GraphGenerator.generateCallings(standalone.getEngine().getProcess(),jbpMethod);
                if (graph.getMethods().size()==0) {
                    continue;
                }

                ExecutionInfoSummary summary = prepareSummary(jbpMethod,pid);
View Full Code Here

Examples of org.jboss.profiler.graphmodel.GraphCallings

        JBPMethodCount consolidacao = process.consolidaCallings(methodParameter);
        java.util.Stack stack = new java.util.Stack();

        HashMap hashMethods = new HashMap();
        HashMap hashCallings = new HashMap();
        GraphCallings graph = new GraphCallings();

        // para ajudar na referencia entre chamadas
        GraphReference referenceKey = new GraphReference();


        long oldMethod = 0;

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


        JBPMethod methodConsolidado = consolidacao.getSpyMethod();
        methodConsolidado = (JBPMethod) spyMethods.get(methodConsolidado);

        generateCallingsRecursive(level, oldMethod, methodParameter, consolidacao,
                hashMethods, hashCallings, referenceKey);

        TreeSet treeSet = new TreeSet(new CompareMethods());
        treeSet.addAll(hashMethods.values());

        ArrayList listMethods = new ArrayList();
        listMethods.addAll(treeSet);
        ArrayList listRefs = new ArrayList();
        listRefs.addAll(hashCallings.values());
        graph.setMethods(listMethods);
        graph.setReferences(listRefs);

        //graph.printDebug();

        return graph;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.