kezhuw commented on code in PR #513:
URL: https://github.com/apache/curator/pull/513#discussion_r1891384141


##########
curator-client/src/main/java/org/apache/curator/drivers/OperationTrace.java:
##########
@@ -33,8 +33,10 @@ public class OperationTrace {
 
     private int returnCode = KeeperException.Code.OK.intValue();
     private long latencyMs;
+    private int requestTransactionCount;
     private long requestBytesLength;
     private long responseBytesLength;
+    private int responseChildrenCount;

Review Comment:
   Default this to `-1` ?
   
   `0` is a valid count for node with no children. This way, client can choose 
to not "record" this field in trace event base on the value.



##########
curator-framework/src/main/java/org/apache/curator/framework/imps/GetChildrenBuilderImpl.java:
##########
@@ -165,14 +165,15 @@ public void performBackgroundOperation(final 
OperationAndData<String> operationA
                 @Override
                 public void processResult(int rc, String path, Object o, 
List<String> strings, Stat stat) {
                     watching.commitWatcher(rc, false);
+                    if (strings == null) {
+                        strings = Lists.newArrayList();
+                    }

Review Comment:
   ```suggestion
   ```



##########
curator-framework/src/main/java/org/apache/curator/framework/imps/GetChildrenBuilderImpl.java:
##########
@@ -165,14 +165,15 @@ public void performBackgroundOperation(final 
OperationAndData<String> operationA
                 @Override
                 public void processResult(int rc, String path, Object o, 
List<String> strings, Stat stat) {
                     watching.commitWatcher(rc, false);
+                    if (strings == null) {
+                        strings = Lists.newArrayList();
+                    }
                     trace.setReturnCode(rc)
                             .setPath(path)
                             .setWithWatcher(watching.hasWatcher())
                             .setStat(stat)
+                            .setResponseChildrenCount(strings.size())

Review Comment:
   ```suggestion
                               .setResponseChildrenCount(strings != null ? 
strings.size() : 0)
   ```



-- 
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]

Reply via email to