You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@samza.apache.org by GitBox <gi...@apache.org> on 2019/07/27 00:51:29 UTC

[GitHub] [samza] shenodaguirguis commented on a change in pull request #1117: [SAMZA-2283] Samza Sql Diagnostics: make latency metrics changes backward compatible

shenodaguirguis commented on a change in pull request #1117: [SAMZA-2283] Samza Sql Diagnostics: make latency metrics changes backward compatible
URL: https://github.com/apache/samza/pull/1117#discussion_r307946188
 
 

 ##########
 File path: samza-api/src/main/java/org/apache/samza/system/IncomingMessageEnvelope.java
 ##########
 @@ -92,21 +92,55 @@ public IncomingMessageEnvelope(SystemStreamPartition systemStreamPartition, Stri
   }
 
   /**
-   * Getter for event time
+   * Getter for event time (Nanos)
    * @return this.eventTime
    */
-  public long getEventTime() {
+  public long getEventTimeNanos() {
     return eventTime;
   }
 
   /**
-   * Getter for arrival time
+   * Getter for arrival time (Nanos)
    * @return this.arrivalTime
    */
-  public long getArrivalTime() {
+  public long getArrivalTimeNanos() {
     return arrivalTime;
   }
 
+  /**
+   * For backward compatibility, Since arrivalTime was in Millis and getArrivalTime was returning
+   * arrivalTime (in Millis)
+   * @return arrivalTime in Millis
+   */
+  public long getArrivalTime() {
+    return getArrivalTimeMillis();
+  }
+
+  /**
+   * For backward compatibility, Since eventTime was in Millis and getEventTime was returning
+   * evenTime (in Millis)
+   * @return
+   */
+  public long getEventTime() {
+    return getEventTimeMillis();
+  }
+
+  /**
+   * Getter for event time in Millis
+   * @return this.eventTime / 10^6
+   */
+  public long getEventTimeMillis() {
+    return eventTime / MILLIS_IN_NANO;
+  }
+
+  /**
+   * Getter for arrival time in Millis
+   * @return this.arrivalTime / 10^6
+   */
+  public long getArrivalTimeMillis() {
 
 Review comment:
   essentially we need to capture latencies in nano or micro seconds resolution, because millis report zero. On local machine testing, 0's for queryLatency becomes non-zero when we use nano. So that is why we switched to nanoTime. To make this change backward compatible, we needed the old get and the new getNano... the getMillis are the natural counterparts for getNano, and the old get uses them...

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services