Search in sources :

Example 16 with Stopwatch

use of org.javasimon.Stopwatch 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 17 with Stopwatch

use of org.javasimon.Stopwatch 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 18 with Stopwatch

use of org.javasimon.Stopwatch 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)

Example 19 with Stopwatch

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

the class MidScaleRepoTest method test020AddBaseUsers.

@Test
public void test020AddBaseUsers() throws ObjectAlreadyExistsException, SchemaException {
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("user.add", "Repository addObject(user) - 1st batch");
    for (int userIndex = 1; userIndex <= BASE_USER_COUNT; userIndex++) {
        String name = String.format("user-%07d", userIndex);
        UserType userType = new UserType(prismContext).name(PolyStringType.fromOrig(name));
        if (userIndex == BASE_USER_COUNT) {
            queryListener.start();
        }
        try (Split ignored = stopwatch.start()) {
            repositoryService.addObject(userType.asPrismObject(), null, operationResult);
        }
        users.put(name, userType.getOid());
    }
    queryListener.dumpAndStop();
}
Also used : Stopwatch(org.javasimon.Stopwatch) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Split(org.javasimon.Split) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) Test(org.testng.annotations.Test)

Example 20 with Stopwatch

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

the class MidScaleRepoTest method test210AddMoreUsers.

@Test
public void test210AddMoreUsers() throws ObjectAlreadyExistsException, SchemaException {
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("user.addMore", "Repository addObject(user) - 2nd batch");
    for (int userIndex = 1; userIndex <= MORE_USER_COUNT; userIndex++) {
        String name = String.format("user-more-%07d", userIndex);
        UserType userType = new UserType(prismContext).name(PolyStringType.fromOrig(name));
        if (userIndex == MORE_USER_COUNT) {
            queryListener.start();
        }
        try (Split ignored = stopwatch.start()) {
            repositoryService.addObject(userType.asPrismObject(), null, operationResult);
        }
        users.put(name, userType.getOid());
    }
    queryListener.dumpAndStop();
}
Also used : Stopwatch(org.javasimon.Stopwatch) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Split(org.javasimon.Split) UserType(com.evolveum.midpoint.xml.ns._public.common.common_3.UserType) Test(org.testng.annotations.Test)

Aggregations

Split (org.javasimon.Split)35 Stopwatch (org.javasimon.Stopwatch)35 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 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 URI (java.net.URI)1