Skip to content

Commit

Permalink
feat: add more logs (#211)
Browse files Browse the repository at this point in the history
* feat: add more logs

* feat: add more logs

* feat: add more logs

---------

Co-authored-by: yushuwang <[email protected]>
  • Loading branch information
2 people authored and rchen9 committed Nov 15, 2023
1 parent e367ed3 commit f1bb82c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,10 @@ public void onBeforeContextExecution(
if (StringUtils.isEmpty(plan.getErrorMessage())) {
plan.setErrorMessage(warmupCase.getSendErrorMessage());
}
throw new RuntimeException(
"Failed to warmup context: " + currentContext + " with case:" + warmupCase);
String errorMsg =
"Failed to warmup context: " + currentContext + " with case:" + warmupCase;
LOGGER.error(errorMsg);
throw new RuntimeException(errorMsg);
}
return true;
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,11 +69,13 @@ DubboInvocation generateDubboInvocation(ReplayActionCaseItem caseItem,
ImmutablePair<String, String> interfaceNameAndMethod =
getInterfaceNameAndMethod(caseItem.getParent().getOperationName());
if (interfaceNameAndMethod == null) {
LOGGER.error("getInterfaceNameAndMethod failed, caseItem:{}", caseItem);
return null;
}
ServiceInstance instanceRunner = selectLoadBalanceInstance(caseItem.getId(),
caseItem.getParent().getTargetInstance());
if (instanceRunner == null) {
LOGGER.error("selectLoadBalanceInstance failed, caseItem:{}", caseItem);
return null;
}
String url = instanceRunner.getUrl();
Expand Down Expand Up @@ -102,11 +104,13 @@ private boolean doSend(ReplayActionCaseItem caseItem, Map<String, String> header
}
}
if (replayInvokeResult == null) {
LOGGER.error("replayInvokeResult is null, caseItem:{}", caseItem);
return false;
}

if (replayInvokeResult.getErrorMsg() != null) {
LOGGER.error("dubbo invoke error msg:{}", replayInvokeResult.getErrorMsg());
LOGGER.error("dubbo invoke error msg:{}, thrown:{}", replayInvokeResult.getErrorMsg(),
replayInvokeResult.getException());
}

ReplaySendResult targetSendResult = fromDubboResult(headers, dubboInvocation.getUrl(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ private boolean doSend(ReplayActionItem replayActionItem, ReplayActionCaseItem c
ServiceInstance instanceRunner = selectLoadBalanceInstance(caseItem.getId(),
replayActionItem.getTargetInstance());
if (instanceRunner == null) {
LOGGER.error("selectLoadBalanceInstance failed, caseItem:{}", caseItem);
return false;
}
String operationName = caseItem.requestPath();
Expand Down

0 comments on commit f1bb82c

Please sign in to comment.