Skip to content

Commit 3aba967

Browse files
Add comment for MemoryUsage.timestamp epoch millis rounding
1 parent 1a911eb commit 3aba967

File tree

1 file changed

+2
-0
lines changed
  • x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats

1 file changed

+2
-0
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/dataframe/stats/MemoryUsage.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ private static ConstructingObjectParser<MemoryUsage, Void> createParser(boolean
5454

5555
public MemoryUsage(String jobId, Instant timestamp, long peakUsageBytes) {
5656
this.jobId = Objects.requireNonNull(jobId);
57+
// We intend to store this timestamp in millis granularity. Thus we're rounding here to ensure
58+
// internal representation matches toXContent
5759
this.timestamp = Instant.ofEpochMilli(ExceptionsHelper.requireNonNull(timestamp, TIMESTAMP).toEpochMilli());
5860
this.peakUsageBytes = peakUsageBytes;
5961
}

0 commit comments

Comments
 (0)