Skip to content
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

chore: log content #200

Merged
merged 1 commit into from
Nov 2, 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
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ public static void recordContextProcessedNormal(PlanExecutionContext<?> context,

public static void recordContextPrepareFailure(PlanExecutionContext<?> context, Throwable t) {
BizLog log = BizLog.error().logType(BizLogContent.CONTEXT_PREPARE_ERR.getType())
.message(BizLogContent.CONTEXT_PREPARE_ERR.format(context.getContextName()))
.message(BizLogContent.CONTEXT_PREPARE_ERR.format(context.getContextName(), t.getMessage()))
.exception(BizLogContent.throwableToString(t)).build();

log.postProcessAndEnqueue(context);
Expand Down Expand Up @@ -227,7 +227,7 @@ public enum BizLogContent {
CONTEXT_AFTER_RUN(202, "Context: {0} done, after hook took {1} ms."),
CONTEXT_SKIP(203, "Context: {0}, Action: {1}, skipped {2} cases "),
CONTEXT_NORMAL(204, "Context: {0}, execute normal, {1} cases sent."),
CONTEXT_PREPARE_ERR(205, "Context: {0}, prepare remote dependency failed."),
CONTEXT_PREPARE_ERR(205, "Context: {0}, prepare remote dependency failed due to {1}."),

ACTION_ITEM_CASE_SAVED(306, "Operation {0} saved total {1} cases to send, took {2} ms."),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@ public void onBeforeContextExecution(
// todo: multi-instance should be supported here
boolean caseSuccess = sender.send(warmupCase, warmupHeader);
if (!caseSuccess) {
if (StringUtils.isEmpty(plan.getErrorMessage())) {
plan.setErrorMessage(warmupCase.getSendErrorMessage());
}
throw new RuntimeException(
"Failed to warmup context: " + currentContext + " with case:" + warmupCase);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ private void finalizePlanStatus(ReplayPlan replayPlan) {
} else if (executionStatus.isInterrupted()) {
progressEvent.onReplayPlanInterrupt(replayPlan, ReplayStatusType.FAIL_INTERRUPTED);
BizLogger.recordPlanStatusChange(replayPlan, ReplayStatusType.FAIL_INTERRUPTED.name(),
"Plan Interrupted by QPS limiter.");
"Plan Interrupted because there are 40+ continuous failure or more than 10% of cases failed.");
} else if (replayPlan.getCaseTotalCount() == 0) {
progressEvent.onReplayPlanFinish(replayPlan);
BizLogger.recordPlanStatusChange(replayPlan, ReplayStatusType.FINISHED.name(),
Expand Down