[ 
https://issues.apache.org/jira/browse/GOBBLIN-1087?focusedWorklogId=404990&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-404990
 ]

ASF GitHub Bot logged work on GOBBLIN-1087:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Mar/20 21:30
            Start Date: 17/Mar/20 21:30
    Worklog Time Spent: 10m 
      Work Description: autumnust commented on pull request #2928: 
GOBBLIN-1087: Track and report histogram of observed lag from Gobblin…
URL: https://github.com/apache/incubator-gobblin/pull/2928#discussion_r393982314
 
 

 ##########
 File path: 
gobblin-modules/gobblin-kafka-common/src/main/java/org/apache/gobblin/source/extractor/extract/kafka/KafkaExtractorStatsTracker.java
 ##########
 @@ -161,14 +208,24 @@ public void resetStartFetchEpochTime(int partitionIdx) {
    * @param decodeStartTime the time instant immediately before a record 
decoding begins.
    * @param recordSizeInBytes the size of the decoded record in bytes.
    * @param logAppendTimestamp the log append time of the {@link 
org.apache.gobblin.kafka.client.KafkaConsumerRecord}.
+   * @param recordCreationTimestamp the time of the {@link 
org.apache.gobblin.kafka.client.KafkaConsumerRecord}.
    */
-  public void onDecodeableRecord(int partitionIdx, long readStartTime, long 
decodeStartTime, long recordSizeInBytes, long logAppendTimestamp) {
+  public void onDecodeableRecord(int partitionIdx, long readStartTime, long 
decodeStartTime, long recordSizeInBytes, long logAppendTimestamp, long 
recordCreationTimestamp) {
     this.statsMap.computeIfPresent(this.partitions.get(partitionIdx), (k, v) 
-> {
       long currentTime = System.nanoTime();
       v.processedRecordCount++;
       v.partitionTotalSize += recordSizeInBytes;
       v.decodeRecordTime += currentTime - decodeStartTime;
       v.readRecordTime += currentTime - readStartTime;
+      if (this.observedLagHistogram != null && recordCreationTimestamp > 0) {
+        long observedLag = System.currentTimeMillis() - 
recordCreationTimestamp;
 
 Review comment:
   Shall we use "latency" instead since "lag" internally refers to number of 
events behind the head of stream ?  Maybe you can come up with better words, it 
is just my intuition of "lag" refers to something else. 
 
----------------------------------------------------------------
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:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 404990)
    Time Spent: 1h 50m  (was: 1h 40m)

> Track and report histogram of observed lag from Gobblin Kafka pipeline
> ----------------------------------------------------------------------
>
>                 Key: GOBBLIN-1087
>                 URL: https://issues.apache.org/jira/browse/GOBBLIN-1087
>             Project: Apache Gobblin
>          Issue Type: Improvement
>          Components: gobblin-kafka
>    Affects Versions: 0.15.0
>            Reporter: Sudarshan Vasudevan
>            Assignee: Shirshanka Das
>            Priority: Major
>             Fix For: 0.15.0
>
>          Time Spent: 1h 50m
>  Remaining Estimate: 0h
>
> In this PR, we instrument the KafkaExtractor to track the observed latency of 
> Kafka consumer records processed by the pipeline. Here, observed latency is 
> measured as the time difference between processing time of the record and the 
> original creation time. The latency distribution is tracked in an 
> HdrHistogram, which is serialized into a string when emitted as part of a 
> GobblinTrackingEvent.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to