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