shounakmk219 commented on code in PR #15118: URL: https://github.com/apache/pinot/pull/15118#discussion_r1968929135
########## pinot-spi/src/main/java/org/apache/pinot/spi/tasks/MinionTaskBaseObserverStats.java: ########## @@ -103,25 +140,70 @@ public boolean equals(Object o) { return false; } MinionTaskBaseObserverStats stats = (MinionTaskBaseObserverStats) o; - return _startTimestamp == stats.getStartTimestamp() && _taskId.equals(stats.getTaskId()) - && _currentState.equals(stats.getCurrentState()); + return _startTimestamp == stats.getStartTimestamp() && _endTimestamp == stats.getEndTimestamp() + && _taskId.equals(stats.getTaskId()) && _currentState.equals(stats.getCurrentState()) + && _currentStage.equals(stats.getCurrentStage()); } @Override public int hashCode() { - return Objects.hash(_taskId, _currentState, _startTimestamp); + return Objects.hash(_taskId, _currentStage, _currentState, _startTimestamp, _endTimestamp); + } + + public static class Timer { + private long _totalTimeMs = 0; + private long _startTimeMs = 0; + private long _resumeTimeMs = 0; + + public Timer() { + } + + public Timer(@JsonProperty("totalTimeMs") long totalTimeMs, + @JsonProperty("startTimeMs") long startTimeMs, + @JsonProperty("resumeTimeMs") long resumeTimeMs) { + _totalTimeMs = totalTimeMs; + _startTimeMs = startTimeMs; + _resumeTimeMs = resumeTimeMs; + } + + public void start() { + _startTimeMs = System.currentTimeMillis(); + _resumeTimeMs = _startTimeMs; Review Comment: Yes that's what I was thinking when introducing it. I wanted to keep this flexibility in case we adopt this where a set of stages is ran in a loop, in which case the cumulative stage time will be tracked. -- 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: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org