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();
}
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();
}
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();
}
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();
}
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
}
Aggregations