use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class TestLdapAssociationPerformance method test020GenerateRoles.
@Test
public void test020GenerateRoles() throws Exception {
Task task = getTestTask();
OperationResult result = task.getResult();
// WHEN
when();
resetPerformanceCollectors();
long startMillis = System.currentTimeMillis();
IntegrationTestTools.setSilentConsole(true);
generateObjects(RoleType.class, NUMBER_OF_GENERATED_ROLES, GENERATED_ROLE_NAME_FORMAT, GENERATED_ROLE_OID_FORMAT, (role, i) -> role.beginAssignment().targetRef(ROLE_META_OID, RoleType.COMPLEX_TYPE), role -> addObject(role, task, result), result);
IntegrationTestTools.setSilentConsole(false);
// THEN
then();
long endMillis = System.currentTimeMillis();
recordDuration((endMillis - startMillis));
PerformanceInformation performanceInformation = getRepoPerformanceMonitor().getThreadLocalPerformanceInformation();
dumpRepoSnapshot(performanceInformation, "role", NUMBER_OF_GENERATED_ROLES);
dumpGlobalCachePerformanceData();
result.computeStatus();
assertSuccess(result);
assertRoles(getNumberOfRoles() + NUMBER_OF_GENERATED_ROLES);
// dumpLdap();
assertLdapConnectorInstances(1);
}
use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class TestLdapAssociationPerformance method test110RecomputeUsers.
@Test
public void test110RecomputeUsers() throws Exception {
rememberConnectorResourceCounters();
// WHEN
when();
getRepoPerformanceMonitor().clearGlobalPerformanceInformation();
resetGlobalCachePerformanceCollector();
addTask(TASK_RECOMPUTE_1_FILE);
waitForTaskFinish(TASK_RECOMPUTE_1_OID, true, RECOMPUTE_TASK_WAIT_TIMEOUT);
// THEN
then();
recordDuration(getRunDurationMillis(TASK_RECOMPUTE_1_OID));
PerformanceInformation performanceInformation = getRepoPerformanceMonitor().getGlobalPerformanceInformation();
dumpRepoSnapshotPerUser(performanceInformation);
dumpGlobalCachePerformanceData();
OperationStatsType statistics = getTaskTreeOperationStatistics(TASK_RECOMPUTE_1_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));
}
use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class Statistics method refreshRepositoryAndAuditPerformanceInformation.
private void refreshRepositoryAndAuditPerformanceInformation(TaskManagerQuartzImpl taskManager) {
SqlPerformanceMonitorsCollection monitors = taskManager.getSqlPerformanceMonitorsCollection();
PerformanceInformation sqlPerformanceInformation = monitors != null ? monitors.getThreadLocalPerformanceInformation() : null;
if (sqlPerformanceInformation != null) {
repositoryPerformanceInformation = sqlPerformanceInformation.toRepositoryPerformanceInformationType();
} else {
// probably we are not collecting these
repositoryPerformanceInformation = null;
}
}
use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class InternalsPerformancePanel method getStatistics.
@SuppressWarnings("Duplicates")
private String getStatistics() {
StringBuilder sb = new StringBuilder();
MidPointApplication midPointApplication = MidPointApplication.get();
if (midPointApplication != null) {
PerformanceInformation performanceInformation = midPointApplication.getSqlPerformanceMonitorsCollection().getGlobalPerformanceInformation();
sb.append("SQL performance information (repository, audit)\n\n").append(RepositoryPerformanceInformationUtil.format(performanceInformation.toRepositoryPerformanceInformationType())).append("\n");
}
Map<String, CachePerformanceCollector.CacheData> cache = CachePerformanceCollector.INSTANCE.getGlobalPerformanceMap();
if (cache != null) {
sb.append("Cache performance information\n\n").append(CachePerformanceInformationUtil.format(CachePerformanceInformationUtil.toCachesPerformanceInformationType(cache))).append("\n");
sb.append("Cache performance information (extra - experimental):\n").append(CachePerformanceInformationUtil.formatExtra(cache)).append("\n");
} else {
sb.append("Cache performance information is currently not available." + "Please set up cache monitoring in the system configuration.\n\n");
}
OperationsPerformanceInformation methods = OperationsPerformanceMonitor.INSTANCE.getGlobalPerformanceInformation();
if (methods != null) {
sb.append("Methods performance information\n\n").append(OperationsPerformanceInformationUtil.format(OperationsPerformanceInformationUtil.toOperationsPerformanceInformationType(methods))).append("\n");
} else {
sb.append("Methods performance information is currently not available." + "Please set up performance monitoring in the system configuration.\n\n");
}
return sb.toString();
}
use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.
the class AbstractStoryTest method dumpThreadLocalPerformanceData.
// TODO: used on demand/temporarily? then mark with suppress warning + comment
@UnusedTestElement
protected PerformanceInformation dumpThreadLocalPerformanceData(String testName) {
PerformanceInformation performanceInformation = getRepoPerformanceMonitor().getThreadLocalPerformanceInformation();
dumpRepoPerformanceData("Repo operations for " + testName, performanceInformation);
dumpCachePerformanceData(testName, CachePerformanceCollector.INSTANCE.getThreadLocalPerformanceMap());
return performanceInformation;
}
Aggregations