Search in sources :

Example 21 with Split

use of org.javasimon.Split 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 22 with Split

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

Example 23 with Split

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

the class MidScaleRepoTest method test710GetUserMore.

@Test
public void test710GetUserMore() throws SchemaException, ObjectNotFoundException {
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("user.get2", "Repository getObject() -> user, 2nd test");
    for (int i = 1; i <= FIND_COUNT; i++) {
        String randomName = String.format("user-more-%07d", RND.nextInt(MORE_USER_COUNT) + 1);
        if (i == FIND_COUNT) {
            queryListener.start();
        }
        try (Split ignored = stopwatch.start()) {
            assertThat(repositoryService.getObject(UserType.class, users.get(randomName), null, operationResult)).isNotNull();
        }
    }
    queryListener.dumpAndStop();
}
Also used : Stopwatch(org.javasimon.Stopwatch) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Split(org.javasimon.Split) Test(org.testng.annotations.Test)

Example 24 with Split

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

the class MidScaleRepoTest method test230AddMoreShadows.

@Test
public void test230AddMoreShadows() throws ObjectAlreadyExistsException, SchemaException {
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("shadow.addMore", "Repository addObject(shadow) - 2nd batch");
    for (int userIndex = 1; userIndex <= MORE_USER_COUNT; userIndex++) {
        for (Map.Entry<String, String> resourceEntry : resources.entrySet()) {
            String name = String.format("shadow-more-%07d-at-%s", userIndex, resourceEntry.getKey());
            ShadowType shadowType = createShadow(name, resourceEntry.getValue());
            // for the last user, but only once for a single resource
            if (userIndex == MORE_USER_COUNT && queryListener.hasNoEntries()) {
                queryListener.start();
            }
            try (Split ignored = stopwatch.start()) {
                repositoryService.addObject(shadowType.asPrismObject(), null, operationResult);
            }
            if (queryListener.isStarted()) {
                queryListener.stop();
            }
        }
    }
    queryListener.dumpAndStop();
}
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 25 with Split

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

the class MidScaleRepoTest method test610AddPeakUsers.

@Test
public void test610AddPeakUsers() throws ObjectAlreadyExistsException, SchemaException {
    OperationResult operationResult = createOperationResult();
    Stopwatch stopwatch = stopwatch("user.addPeak", "Repository addObject(user) - 3rd batch");
    for (int userIndex = 1; userIndex <= PEAK_USER_COUNT; userIndex++) {
        String name = String.format("user-peak-%07d", userIndex);
        UserType userType = new UserType(prismContext).name(PolyStringType.fromOrig(name));
        try (Split ignored = stopwatch.start()) {
            repositoryService.addObject(userType.asPrismObject(), null, operationResult);
        }
        users.put(name, userType.getOid());
    }
// no query listener in this test
}
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)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