Skip to content

Commit

Permalink
for issue WeBankFinTech#61:add log for cost time
Browse files Browse the repository at this point in the history
  • Loading branch information
keranbingaa committed Sep 4, 2022
1 parent 7bf01c0 commit 3176543
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private void pullMessage(final PullRequest pullRequest) {

long rt = System.currentTimeMillis() - beginPullRequestTime;
if (rt >= brokerHealthyManager.getIsolateThreshold()) {
brokerHealthyManager.isolateBroker(pullRequest.getMessageQueue().getBrokerName());
brokerHealthyManager.isolateBroker(pullRequest.getMessageQueue().getBrokerName(), rt);
}
} else {
log.warn("No matched consumer for the PullRequest {}, drop it", pullRequest);
Expand Down Expand Up @@ -154,10 +154,10 @@ public void removeIsolateBroker(String brokerName) {
}
}

public void isolateBroker(String brokerName) {
public void isolateBroker(String brokerName, long rt) {
isolatedBroker.put(brokerName, System.currentTimeMillis());
if (isolatedBroker.containsKey(brokerName)) {
log.info("isolate broker for slow pull message success, {}", brokerName);
log.info("isolate broker for slow pull message success, {}, cost:{} ms", brokerName, rt);
}
}

Expand Down

0 comments on commit 3176543

Please sign in to comment.