use of com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff in project honest-profiler by jvm-profiling-tools.
the class ReferenceUtil method switchReference.
/**
* Set the reference of all {@link Node}s contained in the provided {@link Tree} according to the specified
* {@link ReferenceMode}. The reference of a {@link Node} is used for calculating the percentage values.
* <p>
* Please consult the {@link ReferenceMode} documentation for more information about the meaning of the reference
* modes.
* <p>
* WARNING : the {@link ReferenceMode#THREAD} mode can only be used for {@link Tree}s or {@link TreeDiff}s where the
* top-level children represent thread-level aggregations. Similarly, the {@link ReferenceMode#PARENT} mode can only
* be used in {@link Tree}s or {@link TreeDiff}s.
* <p>
* @param tree the {@link Tree} whose references are to be changed
* @param mode the strategy for setting the references
*/
public static void switchReference(Tree tree, ReferenceMode mode) {
switch(mode) {
case GLOBAL:
NumericInfo global = tree.getSource().getGlobalData();
tree.flatten().forEach(node -> node.setReference(global));
return;
case THREAD:
tree.getData().forEach(rootNode -> {
// The root nodes are presumed to be thread-level aggregations. If not, the results are unspecified.
NumericInfo reference = rootNode.getData();
rootNode.getChildren().forEach(child -> child.flatten().forEach(node -> node.setReference(reference)));
});
return;
case PARENT:
tree.getData().forEach(node -> setReferenceToParent(null, node));
return;
}
}
use of com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff in project honest-profiler by jvm-profiling-tools.
the class FlameDiffViewController method initialize.
@Override
@FXML
protected void initialize() {
diff = new TreeDiff();
super.initialize(DIFFENTRY);
super.initializeFiltering(filterController, filterButton, quickFilterButton, quickFilterText);
super.initializeGrouping(threadGroupingLabel, threadGrouping, frameGroupingLabel, frameGrouping);
}
use of com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff in project honest-profiler by jvm-profiling-tools.
the class TreeDiffViewController method initialize.
// FXML Implementation
@Override
@FXML
protected void initialize() {
diff = new TreeDiff();
super.initialize(DIFFENTRY);
super.initializeFiltering(filterController, filterButton, quickFilterButton, quickFilterText);
super.initializeGrouping(threadGroupingLabel, threadGrouping, frameGroupingLabel, frameGrouping);
super.initializeColumnView(columnViewButton);
createColumnSets();
}
use of com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff in project honest-profiler by jvm-profiling-tools.
the class TreeDiffAggregatorTest method testScenario.
// Actual Test Method
@Test
public void testScenario() {
TreeGenerator baseGen;
TreeGenerator newGen;
baseGen = new TreeGenerator(threadGrouping, frameGrouping);
baseScenario.executeAndEnd(baseGen);
newGen = new TreeGenerator(threadGrouping, frameGrouping);
newScenario.executeAndEnd(newGen);
TreeDiff diff = new TreeDiff();
diff.set(baseGen.getTree(), newGen.getTree());
baseScenario.checkTreeDiffAggregation(newScenario, new TreeDiffCheckAdapter(diff));
}
use of com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff in project honest-profiler by jvm-profiling-tools.
the class TreeDiffViewController method refresh.
// AbstractViewController Implementation
@Override
protected void refresh() {
diff = new TreeDiff();
updateDiff(getBaseTarget(), getNewTarget());
}
Aggregations