sv2000 commented on a change in pull request #2928: GOBBLIN-1087: Track and 
report histogram of observed lag from Gobblin…
URL: https://github.com/apache/incubator-gobblin/pull/2928#discussion_r393837517
 
 

 ##########
 File path: 
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaExtractorStatsTracker.java
 ##########
 @@ -398,5 +480,8 @@ public void reset() {
     for (int partitionIdx = 0; partitionIdx < this.partitions.size(); 
partitionIdx++) {
       resetStartFetchEpochTime(partitionIdx);
     }
+    if (this.observedLagHistogram != null) {
+      this.observedLagHistogram.reset();
 
 Review comment:
   Added benchmark to compare reset vs a new Histogram creation. While both 
reset and new are cheap, reset is 3x cheaper than new object creation. reset 
simply keeps the allocated count array as is and zeroes out the array. In 
general, it would be better to avoid new object creation to avoid GCs/memory 
fragmentation that can occur over time. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to