use of org.javasimon.Stopwatch 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.Stopwatch 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.Stopwatch 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
}
use of org.javasimon.Stopwatch in project midpoint by Evolveum.
the class MidScaleRepoTest method test615AddPeakUsersWithOid.
@Test
public void test615AddPeakUsersWithOid() throws ObjectAlreadyExistsException, SchemaException {
OperationResult operationResult = createOperationResult();
Stopwatch stopwatch = stopwatch("user.addPeakWithOid", "Repository addObject(user) - 4th batch");
for (int userIndex = 1; userIndex <= PEAK_USER_COUNT; userIndex++) {
String name = String.format("user-peak-oid-%07d", userIndex);
UserType userType = new UserType(prismContext).oid(UUID.randomUUID().toString()).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
}
use of org.javasimon.Stopwatch in project midpoint by Evolveum.
the class MidScaleRepoTest method test030AddBaseShadows.
@Test
public void test030AddBaseShadows() throws ObjectAlreadyExistsException, SchemaException {
OperationResult operationResult = createOperationResult();
Stopwatch stopwatch = stopwatch("shadow.add", "Repository addObject(shadow) - 1st batch");
for (int userIndex = 1; userIndex <= BASE_USER_COUNT; userIndex++) {
for (Map.Entry<String, String> resourceEntry : resources.entrySet()) {
String name = String.format("shadow-%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 == BASE_USER_COUNT && queryListener.hasNoEntries()) {
queryListener.start();
}
try (Split ignored = stopwatch.start()) {
repositoryService.addObject(shadowType.asPrismObject(), null, operationResult);
}
if (queryListener.isStarted()) {
// stop does not clear entries, so it will not be started again
queryListener.stop();
}
}
}
queryListener.dumpAndStop();
}
Aggregations