use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class TestRepositoryCache method getOperationCount.
private int getOperationCount(String operation) {
PerformanceInformation performanceInformation = repositoryCache.getPerformanceMonitor().getGlobalPerformanceInformation();
OperationPerformanceInformation opData = // performanceInformation.getAllData().get(operation);
performanceInformation.getAllData().get(opNamePrefix + operation);
return opData != null ? opData.getInvocationCount() : 0;
}
use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class TestRepositoryCache method dumpStatistics.
private void dumpStatistics() {
PerformanceInformation performanceInformation = repositoryCache.getPerformanceMonitor().getGlobalPerformanceInformation();
displayValue("Repository statistics", RepositoryPerformanceInformationUtil.format(performanceInformation.toRepositoryPerformanceInformationType()));
Map<String, CachePerformanceCollector.CacheData> cache = CachePerformanceCollector.INSTANCE.getGlobalPerformanceMap();
displayValue("Cache performance information (standard)", CachePerformanceInformationUtil.format(CachePerformanceInformationUtil.toCachesPerformanceInformationType(cache)));
displayValue("Cache performance information (extra)", CachePerformanceInformationUtil.formatExtra(cache));
}
use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class TestLdapAssociationPerformance method test100AddUsers.
@Test
public void test100AddUsers() throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();
// WHEN
when();
resetPerformanceCollectors();
long startMillis = System.currentTimeMillis();
IntegrationTestTools.setSilentConsole(true);
generateObjects(UserType.class, NUMBER_OF_GENERATED_USERS, GENERATED_USER_NAME_FORMAT, null, (user, i) -> {
user.fullName(String.format(GENERATED_USER_FULL_NAME_FORMAT, i)).givenName(String.format(GENERATED_USER_GIVEN_NAME_FORMAT, i)).familyName(String.format(GENERATED_USER_FAMILY_NAME_FORMAT, i));
PrismProperty<Object> memberOf;
try {
memberOf = user.asPrismObject().createExtension().getValue().findOrCreateProperty(new ItemName("memberOf"));
for (int roleIndex = 0; roleIndex < NUMBER_OF_GENERATED_ROLES; roleIndex++) {
memberOf.addRealValue(String.format(GENERATED_ROLE_NAME_FORMAT, roleIndex));
}
} catch (SchemaException e) {
throw new AssertionError(e.getMessage(), e);
}
}, user -> addObject(user, task, result), result);
IntegrationTestTools.setSilentConsole(false);
// THEN
then();
long endMillis = System.currentTimeMillis();
recordDuration((endMillis - startMillis));
PerformanceInformation performanceInformation = getRepoPerformanceMonitor().getThreadLocalPerformanceInformation();
dumpRepoSnapshotPerUser(performanceInformation);
dumpGlobalCachePerformanceData();
result.computeStatus();
assertSuccess(result);
// dumpLdap();
assertLdapConnectorInstances(1);
}
use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class TestLdapAssociationPerformance method test130RecomputeUsersMultinode.
@Test
public void test130RecomputeUsersMultinode() throws Exception {
rememberConnectorResourceCounters();
// WHEN
when();
getRepoPerformanceMonitor().clearGlobalPerformanceInformation();
resetGlobalCachePerformanceCollector();
addTask(TASK_RECOMPUTE_MULTINODE_FILE);
IntegrationTestTools.setSilentConsole(true);
waitForTaskTreeNextFinishedRun(TASK_RECOMPUTE_MULTINODE_OID, RECOMPUTE_TASK_WAIT_TIMEOUT);
IntegrationTestTools.setSilentConsole(false);
// THEN
then();
recordDuration(getTreeRunDurationMillis(TASK_RECOMPUTE_MULTINODE_OID));
PerformanceInformation performanceInformation = getRepoPerformanceMonitor().getGlobalPerformanceInformation();
dumpRepoSnapshotPerUser(performanceInformation);
dumpGlobalCachePerformanceData();
OperationStatsType statistics = getTaskTreeOperationStatistics(TASK_RECOMPUTE_MULTINODE_OID);
displayOperationStatistics(statistics);
assertNotNull(statistics);
assertUsers(getNumberOfUsers() + NUMBER_OF_GENERATED_USERS);
assertLdapAccounts(getNumberOfLdapAccounts() + NUMBER_OF_GENERATED_USERS);
// assertLdapConnectorInstances(1);
assertSteadyResource();
// assertCounterIncrement(InternalCounters.CONNECTOR_OPERATION_COUNT, 1);
assertCounterIncrement(InternalCounters.CONNECTOR_MODIFICATION_COUNT, 0);
// dumpTaskTree(TASK_RECOMPUTE_MULTINODE_OID, result);
// TODO
// assertEquals("Wrong success count", NUMBER_OF_GENERATED_USERS, TaskOperationStatsUtil.getItemsProcessedWithSuccess(statistics));
}
use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class TestLdapAssociationPerformance method test200RecomputeUsersNoDefaultRoleCache.
@Test
public void test200RecomputeUsersNoDefaultRoleCache() throws Exception {
rememberConnectorResourceCounters();
Task task = getTestTask();
OperationResult result = task.getResult();
// WHEN
when();
PrismObject<SystemConfigurationType> newConfiguration = parseObject(SYSTEM_CONFIGURATION_NO_ROLE_CACHE_FILE);
repositoryService.addObject(newConfiguration, RepoAddOptions.createOverwrite(), result);
getRepoPerformanceMonitor().clearGlobalPerformanceInformation();
resetGlobalCachePerformanceCollector();
addTask(TASK_RECOMPUTE_4_FILE);
waitForTaskFinish(TASK_RECOMPUTE_4_OID, true, RECOMPUTE_TASK_WAIT_TIMEOUT);
// THEN
then();
recordDuration(getRunDurationMillis(TASK_RECOMPUTE_4_OID));
// todo retrieve this information from finished task
PerformanceInformation performanceInformation = getRepoPerformanceMonitor().getGlobalPerformanceInformation();
dumpRepoSnapshotPerUser(performanceInformation);
dumpGlobalCachePerformanceData();
OperationStatsType statistics = getTaskTreeOperationStatistics(TASK_RECOMPUTE_4_OID);
displayOperationStatistics(statistics);
assertNotNull(statistics);
assertUsers(getNumberOfUsers() + NUMBER_OF_GENERATED_USERS);
assertLdapAccounts(getNumberOfLdapAccounts() + NUMBER_OF_GENERATED_USERS);
// assertLdapConnectorInstances(1);
assertSteadyResource();
// assertCounterIncrement(InternalCounters.CONNECTOR_OPERATION_COUNT, 1);
assertCounterIncrement(InternalCounters.CONNECTOR_MODIFICATION_COUNT, 0);
// TODO
// assertEquals("Wrong success count", NUMBER_OF_GENERATED_USERS, TaskOperationStatsUtil.getItemsProcessedWithSuccess(statistics));
}
Aggregations