Package org.jboss.profiler.model

Examples of org.jboss.profiler.model.JBPMethodCount


    public static GraphCallings generateCallings(JBPProcess process, JBPMethod methodParameter) {

        java.util.HashMap spyMethods = process.getSpyMethods();

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


        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,
                    hashCallings, referenceKey);

        }

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.