Skip to content

feat: add multiOperationStrictMatch metric tag #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion arex-storage-config/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<parent>
<artifactId>arex-storage-service</artifactId>
<groupId>com.arextest</groupId>
<version>1.0.33</version>
<version>1.0.34</version>
</parent>

<properties>
Expand Down
2 changes: 1 addition & 1 deletion arex-storage-model/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<artifactId>arex-storage-service</artifactId>
<groupId>com.arextest</groupId>
<version>1.0.33</version>
<version>1.0.34</version>
</parent>

</project>
2 changes: 1 addition & 1 deletion arex-storage-web-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@
<parent>
<artifactId>arex-storage-service</artifactId>
<groupId>com.arextest</groupId>
<version>1.0.33</version>
<version>1.0.34</version>
</parent>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ final class DefaultMockResultProviderImpl implements MockResultProvider {
private static final String CALL_REPLAY_MAX = "callReplayMax";
private static final String DUBBO_PREFIX = "Dubbo";
private static final String STRICT_MATCH = "strictMatch";
private static final String MULTI_OPERATION_WITH_STRICT_MATCH = "multiOperationStrictMatch";
private static final String FUZZY_MATCH = "fuzzyMatch";
private static final String SIMILARITY_MATCH = "similarityMatch";
private static final String COMMA_STRING = ",";
Expand Down Expand Up @@ -450,7 +451,7 @@ private byte[] getMockResultWithSimilarityMatch(MockCategoryType category,
matchedRecordInstanceIds.add(id);
updateUsedRecordInstanceData(category, recordIdBytes, replayIdBytes, operationName,
matchedRecordInstanceIds);
matchStrategyMetricService.recordMatchingCount(STRICT_MATCH, (AREXMocker) mockItem);
matchStrategyMetricService.recordMatchingCount(MULTI_OPERATION_WITH_STRICT_MATCH, (AREXMocker) mockItem);
LOGGER.info(
"[[title=similarityMatch]]get mock result with strictly match, instanceId: {}, matchedRecordInstanceIds: {}",
id, matchedRecordInstanceIds);
Expand Down Expand Up @@ -484,19 +485,6 @@ private byte[] getMockResultWithSimilarityMatch(MockCategoryType category,
}

String recordRequestBody = getRequestBody(mocker.getTargetRequest(), category);
if (StringUtils.equals(replayRequestBody, recordRequestBody)) {
String mockerId = mocker.getId();
mockItem.setId(mockerId);
matchedRecordInstanceIds.add(mockerId);
updateUsedRecordInstanceData(category, recordIdBytes, replayIdBytes, operationName,
matchedRecordInstanceIds);
matchStrategyMetricService.recordMatchingCount(STRICT_MATCH, (AREXMocker) mockItem);
LOGGER.info(
"[[title=similarityMatch]]get mock result with strictly match, instanceId: {}, matchedRecordInstanceIds: {}",
mockerId, matchedRecordInstanceIds);
return mockDataBytes;
}

int sumLength = calc(replayRequestBody, recordRequestBody);

LOGGER.info("[[title=similarityMatch]]recordInstanceId: {}, sumLength: {}",
Expand Down Expand Up @@ -530,8 +518,8 @@ private byte[] getMockResultWithSimilarityMatch(MockCategoryType category,
matchedRecordInstanceIds);
}
LOGGER.info(
"[[title=similarityMatch]]operation: {}, matchedInstanceId: {}, matchedRecordInstanceIds:{}",
length, instanceId, matchedRecordInstanceIds);
"[[title=similarityMatch]]get mock result with similarity match, operation: {}, length: {}, matchedInstanceId: {}, matchedRecordInstanceIds:{}",
operationName, length, instanceId, matchedRecordInstanceIds);

// 4.5. buried point record the number of times similarity is used.
matchStrategyMetricService.recordMatchingCount(SIMILARITY_MATCH, (AREXMocker) mockItem);
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -397,5 +397,5 @@
<url>https://github.com/arextest/arex-storage</url>


<version>1.0.33</version>
<version>1.0.34</version>
</project>