use of com.jetbrains.actionscript.profiler.sampler.FrameInfo in project intellij-plugins by JetBrains.
the class CallTreeTestUtil method getCallTreeNodeFromXmlTag.
private static CallTreeNode getCallTreeNodeFromXmlTag(XmlTag rootTag) {
int count = Integer.MAX_VALUE;
String countStr = rootTag.getAttributeValue("count");
if (countStr != null) {
count = Integer.parseInt(countStr);
}
FrameInfo frameInfo = FrameUtil.getFrameInfo(rootTag.getName());
CallTreeNode node = new CallTreeNode(frameInfo, count);
if (rootTag.isEmpty()) {
return node;
}
for (XmlTag childTag : rootTag.getSubTags()) {
CallTreeNode childNode = getCallTreeNodeFromXmlTag(childTag);
node.addChildRecursive(childNode);
Assert.assertTrue("Bad edge " + node.getFrameInfo() + "->" + childNode.getFrameInfo(), childNode.calcSelfTiming() <= count);
}
return node;
}
use of com.jetbrains.actionscript.profiler.sampler.FrameInfo in project intellij-plugins by JetBrains.
the class CPUSnapshotView method buildPerformanceSamples.
private void buildPerformanceSamples(final DefaultTreeModel treeModel) {
final boolean skipSystemStuff = myFilterSystemStuff.isSelected();
CallTree filteredCallTree = rawCallTree;
if (skipSystemStuff) {
filteredCallTree = CallTreeUtil.filterSystemStuff(filteredCallTree);
}
final Pair<Map<FrameInfo, Long>, Map<FrameInfo, Long>> countMaps = filteredCallTree.getTimeMaps();
final Map<FrameInfo, Long> countMap = countMaps.getFirst();
final Map<FrameInfo, Long> selfCountMap = countMaps.getSecond();
DefaultMutableTreeNode tracesRoot = (DefaultMutableTreeNode) treeModel.getRoot();
JTreeUtil.removeChildren(tracesRoot, treeModel);
fillTreeModelRoot(tracesRoot, filteredCallTree, countMap, selfCountMap, true, FrameInfo.EMPTY_FRAME_INFO_ARRAY);
treeModel.reload();
}
use of com.jetbrains.actionscript.profiler.sampler.FrameInfo in project intellij-plugins by JetBrains.
the class CPUSnapshotView method createHotSpotsTreeTable.
private void createHotSpotsTreeTable() {
myHotSpotsTreeTable = new CallTreeTable(getProject());
myHotSpotsTreeTable.getSelectionModel().addListSelectionListener(new ListSelectionListener() {
public void valueChanged(ListSelectionEvent e) {
final Object node = myHotSpotsTreeTable.getSelectedValue();
if (!(node instanceof MergedCallNode))
return;
myAlarm.cancelAllRequests();
final MergedCallNode mergedCallNode = (MergedCallNode) node;
myAlarm.addRequest(() -> {
FrameInfo[] frames = new FrameInfo[] { mergedCallNode.getFrameInfo() };
final Pair<Map<FrameInfo, Long>, Map<FrameInfo, Long>> countMaps = mergedCallNode.getCallTree().getCalleesTimeMaps(frames);
final Map<FrameInfo, Long> countMap = countMaps.getFirst();
final Map<FrameInfo, Long> selfCountMap = countMaps.getSecond();
DefaultMutableTreeNode tracesRoot = (DefaultMutableTreeNode) myTracesTreeTable.getSortableTreeTableModel().getRoot();
JTreeUtil.removeChildren(tracesRoot, myTracesTreeTable.getSortableTreeTableModel());
fillTreeModelRoot(tracesRoot, mergedCallNode.getCallTree(), countMap, selfCountMap, false, frames);
myTracesTreeTable.reload();
TreeUtil.expand(myTracesTreeTable.getTree(), 1);
}, 500);
}
});
}
Aggregations