Search in sources :

Example 1 with CallInfo

use of com.jetbrains.actionscript.profiler.vo.CallInfo in project intellij-plugins by JetBrains.

the class CallTreeTable method getHotSpotsColumns.

private static ColumnInfo[] getHotSpotsColumns() {
    final ColumnInfo methodsColumn = new ColumnInfo("Methods") {

        @Override
        public Class getColumnClass() {
            return TreeTableModel.class;
        }

        @Override
        public Object valueOf(final Object o) {
            return o;
        }

        @Override
        public Comparator getComparator() {
            return new FrameNameComparator();
        }
    };
    final ColumnInfo countColumn = new AbstractCallColumnInfo("Cumulative time, ms") {

        @Override
        public Comparator<DefaultMutableTreeNode> getComparator() {
            return new CumulativeTimeComparator();
        }

        @Override
        protected long extractValueFromCallInfo(CallInfo value) {
            return value.getCumulativeTime();
        }
    };
    final ColumnInfo selfColumn = new AbstractCallColumnInfo("Self time, ms") {

        @Override
        public Comparator<DefaultMutableTreeNode> getComparator() {
            return new SelfTimeComparator();
        }

        @Override
        protected long extractValueFromCallInfo(CallInfo value) {
            return value.getSelfTime();
        }
    };
    return new ColumnInfo[] { methodsColumn, countColumn, selfColumn };
}
Also used : DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode) CallInfo(com.jetbrains.actionscript.profiler.vo.CallInfo) ColumnInfo(com.intellij.util.ui.ColumnInfo) TreeTableModel(com.intellij.ui.treeStructure.treetable.TreeTableModel)

Example 2 with CallInfo

use of com.jetbrains.actionscript.profiler.vo.CallInfo in project intellij-plugins by JetBrains.

the class MergedCallNode method doLoadChildren.

@Override
protected void doLoadChildren() {
    FrameInfo[] frames = Arrays.copyOf(callFrames, callFrames.length + 1);
    frames[frames.length - 1] = getFrameInfo();
    Pair<Map<FrameInfo, Long>, Map<FrameInfo, Long>> countMaps;
    if (backTrace) {
        countMaps = callTree.getCallersTimeMaps(frames);
    } else {
        countMaps = callTree.getCalleesTimeMaps(ArrayUtil.reverseArray(frames));
    }
    final Map<FrameInfo, Long> countMap = countMaps.getFirst();
    final Map<FrameInfo, Long> selfCountMap = countMaps.getSecond();
    List<FrameInfo> traces = ResolveUtil.filterByScope(countMap.keySet(), scope);
    ArrayList<CallInfo> callInfos = new ArrayList<>();
    for (final FrameInfo t : traces) {
        callInfos.add(new CallInfo(t, countMap.get(t), selfCountMap.get(t)));
    }
    for (int index = 0; index < callInfos.size(); ++index) {
        insert(new MergedCallNode<T>(callInfos.get(index), callTree, frames, backTrace, scope), index);
    }
}
Also used : CallInfo(com.jetbrains.actionscript.profiler.vo.CallInfo) ArrayList(java.util.ArrayList) FrameInfo(com.jetbrains.actionscript.profiler.sampler.FrameInfo) Map(java.util.Map)

Example 3 with CallInfo

use of com.jetbrains.actionscript.profiler.vo.CallInfo in project intellij-plugins by JetBrains.

the class CPUSnapshotView method fillTreeModelRoot.

private <T extends Sample> void fillTreeModelRoot(TreeNode node, CallTree callTree, final Map<FrameInfo, Long> countMap, final Map<FrameInfo, Long> selfCountMap, boolean backTrace, FrameInfo[] frames) {
    final MutableTreeNode root = (MutableTreeNode) node;
    List<FrameInfo> traces = scopeMatcher.fun(new ArrayList<>(countMap.keySet()));
    GlobalSearchScope scope = getCurrentScope();
    int index = 0;
    for (final FrameInfo s : traces) {
        root.insert(new MergedCallNode<T>(new CallInfo(s, countMap.get(s), selfCountMap.get(s)), callTree, frames, backTrace, scope), index++);
    }
}
Also used : FrameInfo(com.jetbrains.actionscript.profiler.sampler.FrameInfo) GlobalSearchScope(com.intellij.psi.search.GlobalSearchScope) CallInfo(com.jetbrains.actionscript.profiler.vo.CallInfo) MutableTreeNode(javax.swing.tree.MutableTreeNode) DefaultMutableTreeNode(javax.swing.tree.DefaultMutableTreeNode)

Aggregations

CallInfo (com.jetbrains.actionscript.profiler.vo.CallInfo)3 FrameInfo (com.jetbrains.actionscript.profiler.sampler.FrameInfo)2 DefaultMutableTreeNode (javax.swing.tree.DefaultMutableTreeNode)2 GlobalSearchScope (com.intellij.psi.search.GlobalSearchScope)1 TreeTableModel (com.intellij.ui.treeStructure.treetable.TreeTableModel)1 ColumnInfo (com.intellij.util.ui.ColumnInfo)1 ArrayList (java.util.ArrayList)1 Map (java.util.Map)1 MutableTreeNode (javax.swing.tree.MutableTreeNode)1