wang-jiahua commented on code in PR #10443:
URL: https://github.com/apache/rocketmq/pull/10443#discussion_r3389166822
##########
remoting/src/main/java/org/apache/rocketmq/remoting/metrics/RemotingMetricsManager.java:
##########
@@ -86,6 +97,44 @@ public List<Pair<InstrumentSelector, ViewBuilder>>
getMetricsView() {
return Lists.newArrayList(new Pair<>(selector, viewBuilder));
}
+ public Attributes getOrBuildAttributes(int requestCode, int responseCode,
+ boolean isLongPolling, String result) {
+ int resultIdx;
+ if (result == RESULT_SUCCESS) resultIdx = 0;
+ else if (result == RESULT_ONEWAY) resultIdx = 1;
+ else if (result == RESULT_WRITE_CHANNEL_FAILED) resultIdx = 2;
+ else if (result == RESULT_CANCELED) resultIdx = 3;
+ else resultIdx = -1;
Review Comment:
Fixed: changed from reference equality (`==`) to `.equals()` for all result
string comparisons in `getOrBuildAttributes`. The four known result constants
are now matched via `RESULT_SUCCESS.equals(result)` etc.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]