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