Search in sources :

Example 1 with PerformanceInformation

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

Example 2 with PerformanceInformation

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

Example 3 with PerformanceInformation

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

Example 4 with PerformanceInformation

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();
}
Also used : MidPointApplication(com.evolveum.midpoint.web.security.MidPointApplication) PerformanceInformation(com.evolveum.midpoint.repo.api.perf.PerformanceInformation) OperationsPerformanceInformation(com.evolveum.midpoint.util.statistics.OperationsPerformanceInformation) OperationsPerformanceInformation(com.evolveum.midpoint.util.statistics.OperationsPerformanceInformation)

Example 5 with PerformanceInformation

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

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