Github user nickwallen commented on a diff in the pull request:

    https://github.com/apache/metron/pull/977#discussion_r178599870
  
    --- Diff: 
metron-analytics/metron-profiler/src/main/java/org/apache/metron/profiler/bolt/ProfileBuilderBolt.java
 ---
    @@ -395,10 +420,46 @@ private void 
emitMeasurements(List<ProfileMeasurement> measurements) {
         return value;
       }
     
    +  /**
    +   * Converts milliseconds to seconds and handles an ugly cast.
    +   *
    +   * @param millis Duration in milliseconds.
    +   * @return Duration in seconds.
    +   */
    +  private int toSeconds(long millis) {
    +    return (int) TimeUnit.MILLISECONDS.toSeconds(millis);
    +  }
    +
    +  /**
    +   * Creates a timer that regularly flushes expired profiles on a separate 
thread.
    +   */
    +  private void startExpiredFlushTimer() {
    +
    +    expiredFlushTimer = createTimer("flush-expired-profiles-timer");
    +    expiredFlushTimer.scheduleRecurring(0, 
toSeconds(profileTimeToLiveMillis), () -> flushExpired());
    +  }
    --- End diff --
    
    This is the timer thread that flushes expired profiles regularly.


---

Reply via email to