Skip to content

Commit

Permalink
Qualify all "path" expressions in the perf test
Browse files Browse the repository at this point in the history
This is to measure the effect of avoiding the full scan in PCVs.
  • Loading branch information
mederly committed May 2, 2023
1 parent 0f2062d commit ed6351a
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
import com.evolveum.midpoint.prism.PrismContainerDefinition;
import com.evolveum.midpoint.prism.PrismObject;
import com.evolveum.midpoint.prism.PrismObjectDefinition;
import com.evolveum.midpoint.prism.path.ItemPath;
import com.evolveum.midpoint.prism.xml.XmlTypeConverter;
import com.evolveum.midpoint.schema.internals.InternalsConfig;
import com.evolveum.midpoint.schema.result.OperationResult;
Expand Down Expand Up @@ -340,10 +339,10 @@ public void test100Import() throws Exception {
.assertSize(SOURCES_CONFIGURATION.getSingleValuedMappings() +
SOURCES_CONFIGURATION.getMultiValuedMappings() +
(memberOf ? 1 : 0))
.property(ItemPath.create(getSingleValuedPropertyName(0)))
.property(getSingleValuedPropertyQName(0))
.assertSize(1)
.end()
.property(ItemPath.create(getMultiValuedPropertyName(0)))
.property(getMultiValuedPropertyQName(0))
.assertSize(SOURCES_CONFIGURATION.getAttributeValues() * SOURCES_CONFIGURATION.getNumberOfResources())
.end()
.end()
Expand Down Expand Up @@ -497,10 +496,19 @@ private long getExecutionTime(PrismObject<TaskType> taskAfter) {
}

@SuppressWarnings("SameParameterValue")
private ItemName getSingleValuedPropertyQName(int i) {
return new ItemName(NS_EXT, getSingleValuedPropertyName(i));
}

private String getSingleValuedPropertyName(int i) {
return String.format("p-single-%04d", i);
}

@SuppressWarnings("SameParameterValue")
private ItemName getMultiValuedPropertyQName(int i) {
return new ItemName(NS_EXT, getMultiValuedPropertyName(i));
}

@SuppressWarnings("SameParameterValue")
private String getMultiValuedPropertyName(int i) {
return String.format("p-multi-%04d", i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
-->

<role xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
oid="7c359aa0-d798-4781-a58b-d6336cb9b1ee">
xmlns:ext="http://midpoint.evolveum.com/xml/ns/test/system-perf"
oid="7c359aa0-d798-4781-a58b-d6336cb9b1ee">
<name>metarole-technical</name>

<inducement>
Expand All @@ -23,7 +24,7 @@
</script>
</expression>
<target>
<path>$user/extension/memberOf</path>
<path>$user/c:extension/ext:memberOf</path>
<set>
<condition>
<script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Configuration parameters:
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:ext="http://midpoint.evolveum.com/xml/ns/test/system-perf">

<name>$resourceInstance</name>
<connectorRef type="c:ConnectorType">
Expand Down Expand Up @@ -58,7 +59,7 @@ Configuration parameters:
<ref>icfs:name</ref>
<inbound>
<target>
<path>name</path>
<path>c:name</path>
</target>
</inbound>
<inbound>
Expand All @@ -69,7 +70,7 @@ Configuration parameters:
</assignmentTargetSearch>
</expression>
<target>
<path>assignment</path>
<path>c:assignment</path>
</target>
</inbound>
</attribute>
Expand All @@ -83,7 +84,7 @@ Configuration parameters:
</script>
</expression>
<target>
<path>extension/p-single-$index</path>
<path>c:extension/ext:p-single-$index</path>
</target>
</inbound>
</attribute>
Expand All @@ -98,7 +99,7 @@ Configuration parameters:
</script>
</expression>
<target>
<path>extension/p-multi-$index</path>
<path>c:extension/ext:p-multi-$index</path>
<set>
<condition>
<script>
Expand Down Expand Up @@ -136,7 +137,7 @@ Configuration parameters:
</assignmentTargetSearch>
</expression>
<target>
<path>assignment</path>
<path>c:assignment</path>
<set>
<condition>
<script>
Expand All @@ -158,9 +159,9 @@ Configuration parameters:
<enabled>true</enabled>
<correlation>
<q:equal>
<q:path>name</q:path>
<q:path>c:name</q:path>
<expression>
<path>$projection/attributes/icfs:name</path>
<path>$projection/c:attributes/icfs:name</path>
</expression>
</q:equal>
</correlation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@ Configuration parameters:
xmlns="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:c="http://midpoint.evolveum.com/xml/ns/public/common/common-3"
xmlns:q="http://prism.evolveum.com/xml/ns/public/query-3"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:icfs="http://midpoint.evolveum.com/xml/ns/public/connector/icf-1/resource-schema-3"
xmlns:mr="http://prism.evolveum.com/xml/ns/public/matching-rule-3"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3"
xmlns:cap="http://midpoint.evolveum.com/xml/ns/public/resource/capabilities-3">
xmlns:ext="http://midpoint.evolveum.com/xml/ns/test/system-perf"
xmlns:ri="http://midpoint.evolveum.com/xml/ns/public/resource/instance-3">

<name>$resourceInstance</name>
<connectorRef type="c:ConnectorType">
Expand Down Expand Up @@ -61,7 +59,7 @@ Configuration parameters:
<ref>icfs:name</ref>
<outbound>
<source>
<path>name</path>
<path>c:name</path>
</source>
</outbound>
</attribute>
Expand All @@ -71,7 +69,7 @@ Configuration parameters:
<outbound>
<source>
<name>data</name>
<path>extension/p-single-$index</path>
<path>c:extension/ext:p-single-$index</path>
</source>
<expression>
<script>
Expand All @@ -87,7 +85,7 @@ Configuration parameters:
<outbound>
<source>
<name>data</name>
<path>extension/p-multi-$index</path>
<path>c:extension/ext:p-multi-$index</path>
</source>
<expression>
<script>
Expand Down Expand Up @@ -124,7 +122,7 @@ Configuration parameters:
<ref>icfs:name</ref>
<outbound>
<source>
<path>identifier</path>
<path>c:identifier</path>
</source>
</outbound>
</attribute>
Expand All @@ -145,7 +143,7 @@ Configuration parameters:
<q:equal>
<q:path>name</q:path>
<expression>
<path>$projection/attributes/icfs:name</path>
<path>$projection/c:attributes/icfs:name</path>
</expression>
</q:equal>
</correlation>
Expand Down

0 comments on commit ed6351a

Please sign in to comment.