Search in sources :

Example 1 with OperationPerformanceInformation

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

the class PerformanceInformationImpl method debugDump.

@Override
public String debugDump(int indent) {
    StringBuilder sb = new StringBuilder();
    DebugUtil.debugDumpLabelLn(sb, "Repository performance information", indent);
    ArrayList<String> operations = new ArrayList<>(operationMap.keySet());
    operations.sort(String::compareTo);
    for (String operation : operations) {
        OperationPerformanceInformation info = operationMap.get(operation);
        if (info != null) {
            DebugUtil.debugDumpWithLabelLn(sb, operation, info.shortDump(), indent + 1);
        }
    }
    return sb.toString();
}
Also used : OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation) ArrayList(java.util.ArrayList)

Example 2 with OperationPerformanceInformation

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

the class SqaleRepoBaseTest method assertOperationRecordedCount.

protected void assertOperationRecordedCount(String opKind, int count) {
    Map<String, OperationPerformanceInformation> pmAllData = getPerformanceMonitor().getGlobalPerformanceInformation().getAllData();
    OperationPerformanceInformation operationInfo = pmAllData.get(opKind);
    if (count != 0) {
        assertThat(operationInfo).withFailMessage("OperationPerformanceInformation for opKind '%s' is missing!", opKind).isNotNull();
        assertThat(operationInfo.getInvocationCount()).isEqualTo(count);
        assertThat(operationInfo.getExecutionCount()).isEqualTo(count);
    } else {
        assertThat(operationInfo).isNull();
    }
}
Also used : OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation)

Example 3 with OperationPerformanceInformation

use of com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation 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 4 with OperationPerformanceInformation

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

the class PerformanceInformationImpl method register.

public void register(OperationRecord operation, boolean alsoObjectType) {
    // operationMap.compute is also atomic, but always replaces new value (even if the reference did not change)
    // so I think this is more efficient, even if it creates empty object each time
    String key = operation.getKind();
    if (alsoObjectType) {
        key += "." + operation.getObjectTypeName();
    }
    operationMap.putIfAbsent(key, new OperationPerformanceInformation());
    operationMap.get(key).register(operation);
}
Also used : OperationPerformanceInformation(com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation)

Aggregations

OperationPerformanceInformation (com.evolveum.midpoint.repo.api.perf.OperationPerformanceInformation)4 PerformanceInformation (com.evolveum.midpoint.repo.api.perf.PerformanceInformation)1 ArrayList (java.util.ArrayList)1