Search in sources :

Example 11 with PerformanceInformation

use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.

the class TestLdapAssociationPerformance method test140RecomputeUsersMultinodeMultithreaded.

@Test
public void test140RecomputeUsersMultinodeMultithreaded() throws Exception {
    rememberConnectorResourceCounters();
    // WHEN
    when();
    getRepoPerformanceMonitor().clearGlobalPerformanceInformation();
    resetGlobalCachePerformanceCollector();
    addTask(TASK_RECOMPUTE_MULTINODE_MULTITHREADED_FILE);
    IntegrationTestTools.setSilentConsole(true);
    waitForTaskTreeNextFinishedRun(TASK_RECOMPUTE_MULTINODE_MULTITHREADED_OID, RECOMPUTE_TASK_WAIT_TIMEOUT);
    IntegrationTestTools.setSilentConsole(false);
    // THEN
    then();
    recordDuration(getTreeRunDurationMillis(TASK_RECOMPUTE_MULTINODE_MULTITHREADED_OID));
    // todo retrieve this information from finished task
    PerformanceInformation performanceInformation = getRepoPerformanceMonitor().getGlobalPerformanceInformation();
    dumpRepoSnapshotPerUser(performanceInformation);
    dumpGlobalCachePerformanceData();
    OperationStatsType statistics = getTaskTreeOperationStatistics(TASK_RECOMPUTE_MULTINODE_MULTITHREADED_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 12 with PerformanceInformation

use of com.evolveum.midpoint.repo.api.perf.PerformanceInformation in project midpoint by Evolveum.

the class TestLdapAssociationPerformance method test120RecomputeUsersNoRoleAndShadowCache.

@Test
public void test120RecomputeUsersNoRoleAndShadowCache() throws Exception {
    rememberConnectorResourceCounters();
    // WHEN
    when();
    getRepoPerformanceMonitor().clearGlobalPerformanceInformation();
    resetGlobalCachePerformanceCollector();
    addTask(TASK_RECOMPUTE_NO_CACHE_FILE);
    waitForTaskFinish(TASK_RECOMPUTE_NO_CACHE_OID, true, RECOMPUTE_TASK_WAIT_TIMEOUT);
    // THEN
    then();
    recordDuration(getRunDurationMillis(TASK_RECOMPUTE_NO_CACHE_OID));
    PerformanceInformation performanceInformation = getRepoPerformanceMonitor().getGlobalPerformanceInformation();
    dumpRepoSnapshotPerUser(performanceInformation);
    dumpGlobalCachePerformanceData();
    OperationStatsType statistics = getTaskTreeOperationStatistics(TASK_RECOMPUTE_NO_CACHE_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 : OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation) PerformanceInformation(com.evolveum.midpoint.repo.api.perf.PerformanceInformation) 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