ChrisSamo632 commented on code in PR #6712:
URL: https://github.com/apache/nifi/pull/6712#discussion_r1030847443


##########
nifi-nar-bundles/nifi-elasticsearch-bundle/nifi-elasticsearch-client-service/src/main/java/org/apache/nifi/elasticsearch/ElasticSearchClientServiceImpl.java:
##########
@@ -790,6 +791,30 @@ private Response performRequest(final String method, final 
String endpoint, fina
         if (entity != null) {
             request.setEntity(entity);
         }
+
+        if (getLogger().isDebugEnabled()) {
+            ByteArrayOutputStream out = new ByteArrayOutputStream();
+            entity.writeTo(out);
+            out.close();
+
+            StringBuilder builder = new StringBuilder();

Review Comment:
   ```suggestion
               StringBuilder builder = new StringBuilder(1000);
   ```
   
   Initialising the `StringBuilder` with a large(r) buffer is sensible when we 
expect to be putting a lot of characters in the String - it's more performant 
(marginal gains, apprectiating this is only being called if DEBUG logging is 
enabled for the class)



-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to