Search in sources :

Example 6 with Node

use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node in project honest-profiler by jvm-profiling-tools.

the class HPFXUtil method newProfileTab.

// Profile Creation
public static final void newProfileTab(FxRobot robot, JavaFXApplication application, int expectedIndex, String name, LogScenario scenario, ProfileMode mode) {
    TabPane tabPane = robot.lookup("#profileTabs").query();
    waitUntil(() -> tabPane.isVisible());
    assertEquals(expectedIndex, tabPane.getTabs().size());
    ProfileContextGenerator gen = new ProfileContextGenerator(application, name, mode);
    waitUntil(asyncFx(() -> gen.createNewProfile(scenario)));
    waitUntil(() -> tabPane.getTabs().size() == expectedIndex + 1);
    Tab tab = tabPane.getTabs().get(expectedIndex);
    waitUntil(() -> ((Parent) tab.getGraphic()).getChildrenUnmodifiable().stream().filter(node -> node instanceof Label && name.equals(((Label) node).getText())).findFirst().isPresent());
}
Also used : EventHandler(javafx.event.EventHandler) Button(javafx.scene.control.Button) DiffEntry(com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffEntry) WaitForAsyncUtils.asyncFx(org.testfx.util.WaitForAsyncUtils.asyncFx) ThreadGrouping(com.insightfullogic.honest_profiler.core.aggregation.grouping.ThreadGrouping) MouseButton(javafx.scene.input.MouseButton) Node(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node) Control(javafx.scene.control.Control) MouseEvent(javafx.scene.input.MouseEvent) TimeoutException(java.util.concurrent.TimeoutException) Callable(java.util.concurrent.Callable) ProfileContextGenerator(com.insightfullogic.honest_profiler.framework.generator.ProfileContextGenerator) WaitForAsyncUtils.waitFor(org.testfx.util.WaitForAsyncUtils.waitFor) Parent(javafx.scene.Parent) Future(java.util.concurrent.Future) TreeTableView(javafx.scene.control.TreeTableView) TabPane(javafx.scene.control.TabPane) JavaFXApplication(com.insightfullogic.honest_profiler.ports.javafx.JavaFXApplication) ContextMenu(javafx.scene.control.ContextMenu) Entry(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Entry) FxRobot(org.testfx.api.FxRobot) Assert.fail(org.junit.Assert.fail) TableView(javafx.scene.control.TableView) FrameGrouping(com.insightfullogic.honest_profiler.core.aggregation.grouping.FrameGrouping) DiffNode(com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffNode) ViewType(com.insightfullogic.honest_profiler.ports.javafx.ViewType) PRIMARY(javafx.scene.input.MouseButton.PRIMARY) LogScenario(com.insightfullogic.honest_profiler.framework.scenario.LogScenario) Label(javafx.scene.control.Label) MenuItem(javafx.scene.control.MenuItem) Boolean.getBoolean(java.lang.Boolean.getBoolean) ChoiceBox(javafx.scene.control.ChoiceBox) DOWN(javafx.scene.input.KeyCode.DOWN) SECONDARY(javafx.scene.input.MouseButton.SECONDARY) ENTER(javafx.scene.input.KeyCode.ENTER) ProfileMode(com.insightfullogic.honest_profiler.ports.javafx.model.ProfileContext.ProfileMode) Tab(javafx.scene.control.Tab) SECONDS(java.util.concurrent.TimeUnit.SECONDS) Assert.assertEquals(org.junit.Assert.assertEquals) TabPane(javafx.scene.control.TabPane) Tab(javafx.scene.control.Tab) Label(javafx.scene.control.Label) ProfileContextGenerator(com.insightfullogic.honest_profiler.framework.generator.ProfileContextGenerator)

Example 7 with Node

use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node in project honest-profiler by jvm-profiling-tools.

the class TreeViewQuickFilterTest method checkResult.

private void checkResult(FxRobot robot, ScenarioStraightFilter... filters) {
    asList(ThreadGrouping.values()).forEach(tg -> {
        asList(FrameGrouping.values()).forEach(fg -> {
            selectThreadGrouping(robot, tg, "#tree");
            selectFrameGrouping(robot, fg, "#tree");
            clickExpandAll(robot, "#tree");
            TreeTableView<Node> tableView = getTreeTableView(robot);
            scenario.checkTreeAggregation(new TreeTableViewCheckAdapter(tg, fg, tableView), filters);
        });
    });
}
Also used : TreeTableViewCheckAdapter(com.insightfullogic.honest_profiler.framework.checker.TreeTableViewCheckAdapter) Node(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node)

Example 8 with Node

use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node in project honest-profiler by jvm-profiling-tools.

the class TreeViewTest method testTreeViewScenario.

// Actual Test Method
@Test
public void testTreeViewScenario() {
    FxRobot robot = new FxRobot();
    newProfileTab(robot, app(), 0, scenario.getName(), scenario, LOG);
    selectView(robot, TREE);
    selectThreadGrouping(robot, threadGrouping, "#tree");
    selectFrameGrouping(robot, frameGrouping, "#tree");
    clickExpandAll(robot, "#tree");
    TreeTableView<Node> tableView = getTreeTableView(robot);
    runLater(() -> scenario.checkTreeAggregation(new TreeTableViewCheckAdapter(threadGrouping, frameGrouping, tableView)));
}
Also used : TreeTableViewCheckAdapter(com.insightfullogic.honest_profiler.framework.checker.TreeTableViewCheckAdapter) Node(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node) FxRobot(org.testfx.api.FxRobot) AbstractJavaFxTest(com.insightfullogic.honest_profiler.ports.javafx.framework.AbstractJavaFxTest) Test(org.junit.Test)

Example 9 with Node

use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node in project honest-profiler by jvm-profiling-tools.

the class TreeGenerator method assertContains.

public static final void assertContains(Tree tree, int selfCount, int totalCount, long selfTime, long totalTime, String... keys) {
    Node node = getNode(tree, keys);
    assertNotNull("No node found with keys " + Arrays.toString(keys) + " (" + tree.getGrouping() + ")", node);
    assertEquals("Wrong self count for entry " + Arrays.toString(keys), selfCount, node.getSelfCnt());
    assertEquals("Wrong total count for entry " + Arrays.toString(keys), totalCount, node.getTotalCnt());
    assertEquals("Wrong self time for entry " + Arrays.toString(keys), selfTime, node.getSelfTime());
    assertEquals("Wrong total time for entry " + Arrays.toString(keys), totalTime, node.getTotalTime());
}
Also used : Node(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node)

Example 10 with Node

use of com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node in project honest-profiler by jvm-profiling-tools.

the class DescendantFlatAggregatorTest method get.

private Flat get(SimplifiedLogScenario scenario, ThreadGrouping tg, FrameGrouping fg, ThreadMeta thread, StackFrame... frames) {
    DescendantFlatAggregator aggregator = new DescendantFlatAggregator();
    TreeGenerator gen = new TreeGenerator(tg, fg);
    scenario.executeAndEnd(gen);
    Node node = gen.getNode(keysFor(tg, fg, thread, frames));
    return aggregator.aggregate(node);
}
Also used : Node(com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node) TreeGenerator(com.insightfullogic.honest_profiler.framework.generator.TreeGenerator)

Aggregations

Node (com.insightfullogic.honest_profiler.core.aggregation.result.straight.Node)13 Tree (com.insightfullogic.honest_profiler.core.aggregation.result.straight.Tree)6 LeanNode (com.insightfullogic.honest_profiler.core.profiles.lean.LeanNode)6 AggregationProfile (com.insightfullogic.honest_profiler.core.aggregation.AggregationProfile)5 CombinedGrouping (com.insightfullogic.honest_profiler.core.aggregation.grouping.CombinedGrouping)5 Keyed (com.insightfullogic.honest_profiler.core.aggregation.result.Keyed)4 Entry (com.insightfullogic.honest_profiler.core.aggregation.result.straight.Entry)3 Map (java.util.Map)3 Collector.of (java.util.stream.Collector.of)3 Collectors.groupingBy (java.util.stream.Collectors.groupingBy)3 Aggregation (com.insightfullogic.honest_profiler.core.aggregation.result.Aggregation)2 TreeTableViewCheckAdapter (com.insightfullogic.honest_profiler.framework.checker.TreeTableViewCheckAdapter)2 ContextMenu (javafx.scene.control.ContextMenu)2 TreeTableView (javafx.scene.control.TreeTableView)2 FrameGrouping (com.insightfullogic.honest_profiler.core.aggregation.grouping.FrameGrouping)1 ThreadGrouping (com.insightfullogic.honest_profiler.core.aggregation.grouping.ThreadGrouping)1 DiffEntry (com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffEntry)1 DiffNode (com.insightfullogic.honest_profiler.core.aggregation.result.diff.DiffNode)1 TreeDiff (com.insightfullogic.honest_profiler.core.aggregation.result.diff.TreeDiff)1 LeanProfile (com.insightfullogic.honest_profiler.core.profiles.lean.LeanProfile)1