Search in sources :

Example 6 with PerformanceInformation

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;
}
Also used : OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation) OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation) PerformanceInformation(com.evolveum.midpoint.repo.api.perf.PerformanceInformation)

Example 7 with PerformanceInformation

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));
}
Also used : OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation) PerformanceInformation(com.evolveum.midpoint.repo.api.perf.PerformanceInformation)

Example 8 with PerformanceInformation

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);
}
Also used : SchemaException(com.evolveum.midpoint.util.exception.SchemaException) Task(com.evolveum.midpoint.task.api.Task) OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation) PerformanceInformation(com.evolveum.midpoint.repo.api.perf.PerformanceInformation) ItemName(com.evolveum.midpoint.prism.path.ItemName) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) PrismObject(com.evolveum.midpoint.prism.PrismObject) Test(org.testng.annotations.Test)

Example 9 with PerformanceInformation

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));
}
Also used : OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation) PerformanceInformation(com.evolveum.midpoint.repo.api.perf.PerformanceInformation) Test(org.testng.annotations.Test)

Example 10 with PerformanceInformation

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));
}
Also used : Task(com.evolveum.midpoint.task.api.Task) OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation) PerformanceInformation(com.evolveum.midpoint.repo.api.perf.PerformanceInformation) OperationResult(com.evolveum.midpoint.schema.result.OperationResult) Test(org.testng.annotations.Test)

Aggregations

PerformanceInformation (com.evolveum.midpoint.repo.api.perf.PerformanceInformation)12 OperationPerformanceInformation (com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation)9 Test (org.testng.annotations.Test)7 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 Task (com.evolveum.midpoint.task.api.Task)3 OperationsPerformanceInformation (com.evolveum.midpoint.util.statistics.OperationsPerformanceInformation)2 PrismObject (com.evolveum.midpoint.prism.PrismObject)1 ItemName (com.evolveum.midpoint.prism.path.ItemName)1 SqlPerformanceMonitorsCollection (com.evolveum.midpoint.repo.api.SqlPerformanceMonitorsCollection)1 UnusedTestElement (com.evolveum.midpoint.tools.testng.UnusedTestElement)1 SchemaException (com.evolveum.midpoint.util.exception.SchemaException)1 MidPointApplication (com.evolveum.midpoint.web.security.MidPointApplication)1