use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Tree in project honest-profiler by jvm-profiling-tools.
the class FlameViewController method refresh.
// AbstractViewController Implementation
@Override
protected void refresh() {
Tree tree = getTarget();
if (tree != null) {
flameCanvas.setWidth(currentWidth);
flameCanvas.setHeight(currentHeight);
flameCanvas.render(tree.filter(getFilterSpecification()));
}
}
use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Tree in project honest-profiler by jvm-profiling-tools.
the class FlameDiffViewCanvas method render.
// AbstractFlameCanvas Implementation
@Override
public void render(final TreeDiff tree) {
clearBlocks();
// The diff should be fully constructed, i.e. both base and new aggregations should be present.
Tree baseTree = tree.getBaseAggregation();
Tree newTree = tree.getNewAggregation();
baseMethodMap = methodMapFor(baseTree);
newMethodMap = methodMapFor(newTree);
final GraphicsContext ctx = getGraphics();
// Total number of samples
long nrSamples = baseTree.getSource().getGlobalData().getTotalCnt() + newTree.getSource().getGlobalData().getTotalCnt();
// TODO Reaggregate when filtering so the width can be calculated properly. Now we have bla
// Total number of samples in the leaves (the Tree may be filtered so we can't use the AggregationProfile global
// data)
// long nrSamples = rootNode.flattenDescendants()
// .filter(node -> node.getChildren().size() == 0)
// .flatMap(node -> node.getAggregatedNodes().stream())
// .mapToLong(node -> node.getData().getTotalCnt()).sum();
// Any frame will be represented with its width proportional to its total sample count divided by the profile
// total sample count
double colWidth = getWidth() / nrSamples;
// Nr Rows = max depth of a stack. The root Node represents all threads, but since the descendant depth of a
// Node without children is defined as 0, this works out fine.
int nrRows = tree.getData().stream().mapToInt(DiffNode::getDescendantDepth).max().getAsInt() + 1;
double rowHeight = max(getHeight() / nrRows, ctx.getFont().getSize() + 2);
double startX = 0;
double startY = getHeight() - rowHeight;
for (DiffNode node : tree.getData()) {
startX += renderNode(ctx, node, 0, colWidth, rowHeight, startX, startY);
}
}
use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Tree in project honest-profiler by jvm-profiling-tools.
the class AncestorTreeAggregatorTest method checkMultipleAncestorsSingleThread.
// Descendants of intermediate node
private void checkMultipleAncestorsSingleThread(ThreadGrouping tg, FrameGrouping fg) {
Tree tree = get(SCENARIOS.get(1), tg, fg, F_03);
assertAggregationSizeEquals(tree, 4);
assertContains(tree, 0, 1, keysFor(fg, F_03));
assertContains(tree, 0, 1, keysFor(fg, F_03, F_04));
assertContains(tree, 0, 1, keysFor(fg, F_03, F_04, F_05));
}
use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Tree in project honest-profiler by jvm-profiling-tools.
the class TreeFilterTest method check.
private <U> void check(TreeGenerator gen, Target target, Comparison comparison, U value, ScenarioStraightFilter filter) {
try {
Tree filtered = gen.filter(treeFilter(target, comparison, value));
scenario.checkTreeAggregation(new TreeCheckAdapter(filtered), filter);
} catch (AssertionError ae) {
throw new AssertionError("Failure : Unfiltered =\n" + gen.getTree(), ae);
}
}
use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Tree in project honest-profiler by jvm-profiling-tools.
the class AncestorTreeAggregatorTest method checkLeafAncestors.
// Descendants of leaf node
private void checkLeafAncestors(ThreadGrouping tg, FrameGrouping fg) {
Tree tree = get(SCENARIOS.get(0), tg, fg, F_01);
assertAggregationSizeEquals(tree, 2);
assertContains(tree, 1, 1, keysFor(fg, F_01));
}
Aggregations