Search in sources :

Example 16 with Split

use of org.javasimon.Split in project midpoint by Evolveum.

the class MidScaleGuiTest method test220newUser.

@Test
public void test220newUser() {
    logger.info(getTestName());
    Stopwatch stopwatch = stopwatch("newUser", "New user");
    for (int i = 0; i < REPETITION_COUNT; i++) {
        tester.startPage(PageUser.class);
        tester.debugComponentTrees();
        try (Split ignored = stopwatch.start()) {
            queryListener.start();
            tester.executeAjaxEvent("detailsView:template:template:additionalButtons:0:additionalButton:compositedButton", "click");
        }
    }
    queryListener.dumpAndStop();
    tester.assertRenderedPage(PageUser.class);
    OperationsPerformanceInformationType performanceInformation = OperationsPerformanceInformationUtil.toOperationsPerformanceInformationType(OperationsPerformanceMonitor.INSTANCE.getGlobalPerformanceInformation());
    displayValue("Operation performance (by name)", OperationsPerformanceInformationUtil.format(performanceInformation));
    displayValue("Operation performance (by time)", OperationsPerformanceInformationUtil.format(performanceInformation, new AbstractStatisticsPrinter.Options(AbstractStatisticsPrinter.Format.TEXT, AbstractStatisticsPrinter.SortBy.TIME), null, null));
// runTestFor(PageUser.class, "newUser", "New user");
}
Also used : Stopwatch(org.javasimon.Stopwatch) Split(org.javasimon.Split) AbstractInitializedGuiIntegrationTest(com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest) Test(org.testng.annotations.Test) AbstractGuiIntegrationTest(com.evolveum.midpoint.web.AbstractGuiIntegrationTest) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 17 with Split

use of org.javasimon.Split in project midpoint by Evolveum.

the class MidScaleGuiTest method test200sidebarMenu.

// doesn't work because of getPageBase usages
@Test(enabled = false)
public void test200sidebarMenu() {
    logger.info(getTestName());
    Stopwatch stopwatch = stopwatch("sidebar", "sidebar perf");
    try (Split ignored = stopwatch.start()) {
        queryListener.start();
        tester.startComponentInPage(LeftMenuPanel.class);
    }
    queryListener.dumpAndStop();
    OperationsPerformanceInformationType performanceInformation = OperationsPerformanceInformationUtil.toOperationsPerformanceInformationType(OperationsPerformanceMonitor.INSTANCE.getGlobalPerformanceInformation());
    displayValue("Operation performance (by name)", OperationsPerformanceInformationUtil.format(performanceInformation));
    displayValue("Operation performance (by time)", OperationsPerformanceInformationUtil.format(performanceInformation, new AbstractStatisticsPrinter.Options(AbstractStatisticsPrinter.Format.TEXT, AbstractStatisticsPrinter.SortBy.TIME), null, null));
}
Also used : Stopwatch(org.javasimon.Stopwatch) Split(org.javasimon.Split) AbstractInitializedGuiIntegrationTest(com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest) Test(org.testng.annotations.Test) AbstractGuiIntegrationTest(com.evolveum.midpoint.web.AbstractGuiIntegrationTest) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 18 with Split

use of org.javasimon.Split in project midpoint by Evolveum.

the class MidScaleGuiTest method runTestFor.

private void runTestFor(Class pageToRender, PageParameters params, String stopwatchName, String stopwatchDescription) {
    Stopwatch stopwatch = stopwatch(stopwatchName, stopwatchDescription);
    for (int i = 0; i < REPETITION_COUNT; i++) {
        try (Split ignored = stopwatch.start()) {
            queryListener.start();
            tester.startPage(pageToRender);
        }
    }
    queryListener.dumpAndStop();
    tester.assertRenderedPage(pageToRender);
    OperationsPerformanceInformationType performanceInformation = OperationsPerformanceInformationUtil.toOperationsPerformanceInformationType(OperationsPerformanceMonitor.INSTANCE.getGlobalPerformanceInformation());
    displayValue("Operation performance (by name)", OperationsPerformanceInformationUtil.format(performanceInformation));
    displayValue("Operation performance (by time)", OperationsPerformanceInformationUtil.format(performanceInformation, new AbstractStatisticsPrinter.Options(AbstractStatisticsPrinter.Format.TEXT, AbstractStatisticsPrinter.SortBy.TIME), null, null));
}
Also used : Stopwatch(org.javasimon.Stopwatch) Split(org.javasimon.Split)

Example 19 with Split

use of org.javasimon.Split in project midpoint by Evolveum.

the class MidScaleGuiTest method test231editUserTabProjections.

@Test
public void test231editUserTabProjections() {
    logger.info(getTestName());
    for (int i = 0; i < REPETITION_COUNT; i++) {
        tester.startPage(PageUsers.class);
        String idTable = "mainForm:table";
        tester.assertComponent(idTable, MainObjectListPanel.class);
        tester.debugComponentTrees(":rows:.*:cells:3:cell:link");
        String id = idTable + ":items:itemsTable:box:tableContainer:table:body:rows:3:cells:3:cell:link";
        tester.clickLink(id);
        Stopwatch stopwatch = stopwatch("showProjections", "User's projection tab");
        try (Split ignored = stopwatch.start()) {
            queryListener.start();
            clickOnDetailsMenu(1, com.evolveum.midpoint.gui.impl.page.admin.user.PageUser.class);
        }
    }
    queryListener.dumpAndStop();
    tester.assertRenderedPage(com.evolveum.midpoint.gui.impl.page.admin.user.PageUser.class);
    OperationsPerformanceInformationType performanceInformation = OperationsPerformanceInformationUtil.toOperationsPerformanceInformationType(OperationsPerformanceMonitor.INSTANCE.getGlobalPerformanceInformation());
    displayValue("Operation performance (by name)", OperationsPerformanceInformationUtil.format(performanceInformation));
    displayValue("Operation performance (by time)", OperationsPerformanceInformationUtil.format(performanceInformation, new AbstractStatisticsPrinter.Options(AbstractStatisticsPrinter.Format.TEXT, AbstractStatisticsPrinter.SortBy.TIME), null, null));
}
Also used : Stopwatch(org.javasimon.Stopwatch) Split(org.javasimon.Split) AbstractInitializedGuiIntegrationTest(com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest) Test(org.testng.annotations.Test) AbstractGuiIntegrationTest(com.evolveum.midpoint.web.AbstractGuiIntegrationTest) SpringBootTest(org.springframework.boot.test.context.SpringBootTest)

Example 20 with Split

use of org.javasimon.Split in project midpoint by Evolveum.

the class MidScaleRepoTest method test611AddPeakShadows.

@Test
public void test611AddPeakShadows() throws ObjectAlreadyExistsException, SchemaException {
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("shadow.addPeak", "Repository addObject(shadow) - 3rd batch");
    for (int userIndex = 1; userIndex <= PEAK_USER_COUNT; userIndex++) {
        for (Map.Entry<String, String> resourceEntry : resources.entrySet()) {
            String name = String.format("shadow-peak-%07d-at-%s", userIndex, resourceEntry.getKey());
            ShadowType shadowType = createShadow(name, resourceEntry.getValue());
            try (Split ignored = stopwatch.start()) {
                repositoryService.addObject(shadowType.asPrismObject(), null, operationResult);
            }
        }
    }
// no query listener in this test
}
Also used : ShadowType(com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType) Stopwatch(org.javasimon.Stopwatch) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Split(org.javasimon.Split) Test(org.testng.annotations.Test)

Aggregations

Split (org.javasimon.Split)38 Stopwatch (org.javasimon.Stopwatch)36 Test (org.testng.annotations.Test)28 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)22 SqaleRepoBaseTest (com.evolveum.midpoint.repo.sqale.SqaleRepoBaseTest)11 ObjectAlreadyExistsException (com.evolveum.midpoint.util.exception.ObjectAlreadyExistsException)8 AbstractGuiIntegrationTest (com.evolveum.midpoint.web.AbstractGuiIntegrationTest)5 AbstractInitializedGuiIntegrationTest (com.evolveum.midpoint.web.AbstractInitializedGuiIntegrationTest)5 UserType (com.evolveum.midpoint.xml.ns._public.common.common_3.UserType)5 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)5 QUser (com.evolveum.midpoint.repo.sqale.qmodel.focus.QUser)4 ShadowType (com.evolveum.midpoint.xml.ns._public.common.common_3.ShadowType)4 SkipException (org.testng.SkipException)3 Objectable (com.evolveum.midpoint.prism.Objectable)1 PrismContainerValue (com.evolveum.midpoint.prism.PrismContainerValue)1 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 PrismParser (com.evolveum.midpoint.prism.PrismParser)1 QResource (com.evolveum.midpoint.repo.sqale.qmodel.resource.QResource)1 AssignmentType (com.evolveum.midpoint.xml.ns._public.common.common_3.AssignmentType)1 ResourceType (com.evolveum.midpoint.xml.ns._public.common.common_3.ResourceType)1