Package org.jboss.profiler.model

Examples of org.jboss.profiler.model.JBPMethodCount


            }

            HashMap spyMethods = spyProcess.getSpyMethods();
            JBPMethod spyMethodProcess = (JBPMethod) spyMethods.get(keyMethod);

            JBPMethodCount consolidacao = (JBPMethodCount) request.getSession()
                    .getAttribute("consolidacaoMetodo");
            if (thread == null
                    && (consolidacao == null
                            || consolidacao.getSpyMethod().equals(
                                    spyMethodProcess) || session
                            .getAttribute("consolidacaoThread") != null)) {
                consolidacao = spyProcess.consolidaCallings(spyMethodProcess);
                session.setAttribute("consolidacaoMetodo", consolidacao);
                session.removeAttribute("consolidacaoThread");
            } else {
                JBPThread consolidacaoThread = (JBPThread) session
                        .getAttribute("consolidacaoThread");
                if (thread != null
                        && (consolidacao == null
                                || consolidacaoThread == null
                                || consolidacaoThread.getThreadId() != threadId
                                        .intValue() || !consolidacao
                                .getSpyMethod().equals(spyMethodProcess))) {
                    consolidacao = thread.consolidaCallings(spyMethodProcess);
                    session.setAttribute("consolidacaoMetodo", consolidacao);
                    session.setAttribute("consolidacaoThread", thread);
                }
View Full Code Here


        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()
                    .getMethodID(), rootMethod, subConsolidacao, hashMethods,
                    hashCallings, referenceKey, path);
            path.pop();

        }
View Full Code Here

        pathSize = Integer.parseInt(request.getParameter("pathSize"));

      int methodsId[] = new int[pathSize];
      JBPMethod metodosPesquisados[] = new JBPMethod[pathSize];

      JBPMethodCount rootCount = null;
      JBPMethodCount consolidacao = null;

      String urlBasesrc = "classId=" + classId;
      for (int i = 0; i < pathSize; i++) {
        methodsId[i] = Integer.parseInt(request.getParameter("m" + i));
        metodosPesquisados[i] =
          (JBPMethod) spyProcess.findMethod(keyMethod, methodsId[i]);
        urlBasesrc += "&m" + i + "=" + methodsId[i];

        if (i == 0) {
          rootCount =
            findMethodOnConsolidations(listMethods, methodsId[i]);
          consolidacao = rootCount;
        } else {
          consolidacao =
            consolidacao.getCalledCount(metodosPesquisados[i]);
        }
      }

      GraphCallings graph =
        generateCallings(
View Full Code Here

  private JBPMethodCount findMethodOnConsolidations(
    Collection listMethods,
    int methodId) {
    Iterator iter = listMethods.iterator();
    while (iter.hasNext()) {
      JBPMethodCount tmpCount = (JBPMethodCount) iter.next();
      if (tmpCount.getSpyMethod().getMethodID() == methodId) {
        return tmpCount;
      }
    }

    return null;
View Full Code Here

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

      key.setMethodId(subConsolidacao.getSpyMethod().getMethodID());
      key.setLevel(level + 1);
      if (hashMethods.get(key) == null) {
        GraphMethod newMethod =
          new GraphMethod(
            subConsolidacao.getSpyMethod(),
            level+1,
            createURL(
              pathSize,
              baseUrl,
              classId,
              path,
              subConsolidacao.getSpyMethod(),
              viewCreation));
        hashMethods.put(newMethod, newMethod);
      }
    }

    iterValues = consolidacao.getCountCalleds().values().iterator();
    while (iterValues.hasNext()) {
      JBPMethodCount subConsolidacao = (JBPMethodCount) iterValues.next();
      int countInUse =
        viewCreation
          ? subConsolidacao.getCount()
          : subConsolidacao.getActiveCount();

      if (viewCreation && countInUse == 0)
        continue;

      key.setMethodId(subConsolidacao.getSpyMethod().getMethodID());
      key.setLevel(level + 1);
      GraphMethod graphMethod = (GraphMethod) hashMethods.get(key);

      if (graphMethod == null) {
        System.out.println("Sorry but I didn't find MethodId=" + key.getMethodId() + " level=" + key.getLevel());
        throw new RuntimeException("Unexpected null method");
      }

      graphMethod.setWeight(graphMethod.getWeight() + countInUse);

      if (methodIdCallee != 0) {
        referenceKey.setMethodCallee(methodIdCallee);
        referenceKey.setLevelCallee(level - 1);
        referenceKey.setMethodCalled(
          subConsolidacao.getSpyMethod().getMethodID());
        referenceKey.setLevelCalled(level);
        if (hashCallings.get(referenceKey) == null) {
          GraphReference ref =
            new GraphReference(
              level,
              methodIdCallee,
              level + 1,
              subConsolidacao.getSpyMethod().getMethodID(),
              countInUse);
          hashCallings.put(ref, ref);
        }
      }

      path.push(subConsolidacao.getSpyMethod());

      generateCallingsRecursive(
        baseUrl,
        pathSize,
        level + 1,
        subConsolidacao.getSpyMethod().getMethodID(),
        classId,
        subConsolidacao,
        hashMethods,
        hashCallings,
        referenceKey,
View Full Code Here

     */
    private static void internalGenerateXML(PrintStream out, JBPProcess process, double minPercent, int maxLevel, boolean printMemory, boolean memoryLeaks, java.text.NumberFormat numberFormat, Iterator methodsIterator) {


        while (methodsIterator.hasNext()) {
            JBPMethodCount count = (JBPMethodCount) methodsIterator.next();

            openTree(maxLevel, minPercent, 0, out, count, count, process,
                    numberFormat, printMemory);

        }
View Full Code Here

        setMethods.addAll(count.getCountCalleds().values());

        Iterator subMethods = setMethods.iterator();

        while (subMethods.hasNext()) {
            JBPMethodCount subCount = (JBPMethodCount) subMethods.next();
            if (maxLevel == 0 || level < maxLevel)
                openTree(maxLevel, minPercentage, level + 1, out, subCount,
                        root, process, numberFormat, printMemory);
        }
View Full Code Here

                + " instances=\"" + count.getCount() + "\"" + " fullName=\""
                + myEncode2(count.getSpyMethod().getFullName()) + "\"" + ">");

        Iterator iterValues = count.getCountCalleds().values().iterator();
        while (iterValues.hasNext()) {
            JBPMethodCount methodCount = (JBPMethodCount) iterValues.next();
            printMemoryLeakMethod(level + 1, out, methodCount);
        }

        printLevel(out, level);
        out.println("</methodOnMemory>");
View Full Code Here

                    .findMemoryLeaks(spyClass);

            Iterator iterMethods = listMethods.iterator();

            while (iterMethods.hasNext()) {
                JBPMethodCount methodCount = (JBPMethodCount) iterMethods
                        .next();
                printMemoryLeakMethod(3, out, methodCount);
            }

            printLevel(out, 2);
View Full Code Here

     * @param summary
     * @param jbpMethod
     */
    private void summarizeMethod(String pid, ExecutionInfoSummary summary, JBPMethod jbpMethod,boolean includeChildrenInMemoryAnalysis) {

        JBPMethodCount consolidation = standalone.getEngine().getProcess().consolidaCallings(jbpMethod);
        Iterator iter;
        if (includeChildrenInMemoryAnalysis) {
            iter = consolidation.createConsolidatedObjects().values().iterator();
        } else {
            iter = consolidation.getCountMemory().values().iterator();
        }

        long bytes=0;
        long releasedBytes=0;
        while (iter.hasNext()) {
View Full Code Here

TOP

Related Classes of org.jboss.profiler.model.JBPMethodCount

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.