Search in sources :

Example 1 with TreeDiff

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;
    }
}
Also used : Tree(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Tree) Node(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node) NumericInfo(com.insightfullogic.honest_profiler.core.profiles.lean.info.NumericInfo) TreeDiff(com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff) NumericInfo(com.insightfullogic.honest_profiler.core.profiles.lean.info.NumericInfo)

Example 2 with TreeDiff

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);
}
Also used : TreeDiff(com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff) FXML(javafx.fxml.FXML)

Example 3 with TreeDiff

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();
}
Also used : TreeDiff(com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff) FXML(javafx.fxml.FXML)

Example 4 with TreeDiff

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));
}
Also used : TreeDiff(com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff) TreeDiffCheckAdapter(com.insightfullogic.honest_profiler.framework.checker.TreeDiffCheckAdapter) TreeGenerator(com.insightfullogic.honest_profiler.framework.generator.TreeGenerator) Test(org.junit.Test)

Example 5 with TreeDiff

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());
}
Also used : TreeDiff(com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff)

Aggregations

TreeDiff (com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff)6 FXML (javafx.fxml.FXML)2 Node (com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node)1 Tree (com.insightfullogic.honest_profiler.core.aggregation.result.straight.Tree)1 NumericInfo (com.insightfullogic.honest_profiler.core.profiles.lean.info.NumericInfo)1 TreeDiffCheckAdapter (com.insightfullogic.honest_profiler.framework.checker.TreeDiffCheckAdapter)1 TreeGenerator (com.insightfullogic.honest_profiler.framework.generator.TreeGenerator)1 Test (org.junit.Test)1