@@ -41,7 +41,8 @@ public class ModelSizeStats implements ToXContentObject, Writeable {
4141 */
4242 public static final ParseField MODEL_BYTES_FIELD = new ParseField ("model_bytes" );
4343 public static final ParseField PEAK_MODEL_BYTES_FIELD = new ParseField ("peak_model_bytes" );
44- public static final ParseField ACTUAL_MEMORY_USAGE_BYTES = new ParseField ("actual_memory_usage_bytes" );
44+ public static final ParseField SYSTEM_MEMORY_BYTES = new ParseField ("system_memory_bytes" );
45+ public static final ParseField MAX_SYSTEM_MEMORY_BYTES = new ParseField ("max_system_memory_bytes" );
4546 public static final ParseField MODEL_BYTES_EXCEEDED_FIELD = new ParseField ("model_bytes_exceeded" );
4647 public static final ParseField MODEL_BYTES_MEMORY_LIMIT_FIELD = new ParseField ("model_bytes_memory_limit" );
4748 public static final ParseField TOTAL_BY_FIELD_COUNT_FIELD = new ParseField ("total_by_field_count" );
@@ -75,7 +76,8 @@ private static ConstructingObjectParser<Builder, Void> createParser(boolean igno
7576 parser .declareString ((modelSizeStat , s ) -> {}, Result .RESULT_TYPE );
7677 parser .declareLong (Builder ::setModelBytes , MODEL_BYTES_FIELD );
7778 parser .declareLong (Builder ::setPeakModelBytes , PEAK_MODEL_BYTES_FIELD );
78- parser .declareLong (Builder ::setActualMemoryUsageBytes , ACTUAL_MEMORY_USAGE_BYTES );
79+ parser .declareLong (Builder ::setSystemMemoryBytes , SYSTEM_MEMORY_BYTES );
80+ parser .declareLong (Builder ::setMaxSystemMemoryBytes , MAX_SYSTEM_MEMORY_BYTES );
7981 parser .declareLong (Builder ::setModelBytesExceeded , MODEL_BYTES_EXCEEDED_FIELD );
8082 parser .declareLong (Builder ::setModelBytesMemoryLimit , MODEL_BYTES_MEMORY_LIMIT_FIELD );
8183 parser .declareLong (Builder ::setBucketAllocationFailuresCount , BUCKET_ALLOCATION_FAILURES_COUNT_FIELD );
@@ -154,7 +156,8 @@ public String toString() {
154156 * 1. The job's model_memory_limit
155157 * 2. The current model memory, i.e. what's reported in model_bytes of this object
156158 * 3. The peak model memory, i.e. what's reported in peak_model_bytes of this object
157- * 4. The actual memory usage, i.e. what's reported in actual_memory_usage_bytes of this object
159+ * 4. The system memory, i.e. what's reported in system_memory_bytes of this object
160+ * 5. The max system memory, i.e. what's reported in max_system_memory_bytes of this object
158161 * The field storing this enum can also be <code>null</code>, which means the
159162 * assignment code will decide on the fly - this was the old behaviour prior
160163 * to 7.11.
@@ -163,7 +166,8 @@ public enum AssignmentMemoryBasis implements Writeable {
163166 MODEL_MEMORY_LIMIT ,
164167 CURRENT_MODEL_BYTES ,
165168 PEAK_MODEL_BYTES ,
166- ACTUAL_MEMORY_USAGE_BYTES ;
169+ SYSTEM_MEMORY_BYTES ,
170+ MAX_SYSTEM_MEMORY_BYTES ,;
167171
168172 public static AssignmentMemoryBasis fromString (String statusName ) {
169173 return valueOf (statusName .trim ().toUpperCase (Locale .ROOT ));
@@ -187,7 +191,8 @@ public String toString() {
187191 private final String jobId ;
188192 private final long modelBytes ;
189193 private final Long peakModelBytes ;
190- private final Long actualMemoryUsageBytes ;
194+ private final Long systemMemoryUsageBytes ;
195+ private final Long maxSystemMemoryUsageBytes ;
191196 private final Long modelBytesExceeded ;
192197 private final Long modelBytesMemoryLimit ;
193198 private final long totalByFieldCount ;
@@ -211,7 +216,8 @@ private ModelSizeStats(
211216 String jobId ,
212217 long modelBytes ,
213218 Long peakModelBytes ,
214- Long actualMemoryUsageBytes ,
219+ Long systemMemoryUsageBytes ,
220+ Long maxSystemMemoryUsageBytes ,
215221 Long modelBytesExceeded ,
216222 Long modelBytesMemoryLimit ,
217223 long totalByFieldCount ,
@@ -234,7 +240,8 @@ private ModelSizeStats(
234240 this .jobId = jobId ;
235241 this .modelBytes = modelBytes ;
236242 this .peakModelBytes = peakModelBytes ;
237- this .actualMemoryUsageBytes = actualMemoryUsageBytes ;
243+ this .systemMemoryUsageBytes = systemMemoryUsageBytes ;
244+ this .maxSystemMemoryUsageBytes = maxSystemMemoryUsageBytes ;
238245 this .modelBytesExceeded = modelBytesExceeded ;
239246 this .modelBytesMemoryLimit = modelBytesMemoryLimit ;
240247 this .totalByFieldCount = totalByFieldCount ;
@@ -259,10 +266,12 @@ public ModelSizeStats(StreamInput in) throws IOException {
259266 jobId = in .readString ();
260267 modelBytes = in .readVLong ();
261268 peakModelBytes = in .readOptionalLong ();
262- if (in .getTransportVersion ().onOrAfter (TransportVersions .ML_AD_ACTUAL_MEMORY_USAGE )) {
263- actualMemoryUsageBytes = in .readOptionalLong ();
269+ if (in .getTransportVersion ().onOrAfter (TransportVersions .ML_AD_SYSTEM_MEMORY_USAGE )) {
270+ systemMemoryUsageBytes = in .readOptionalLong ();
271+ maxSystemMemoryUsageBytes = in .readOptionalLong ();
264272 } else {
265- actualMemoryUsageBytes = null ;
273+ systemMemoryUsageBytes = null ;
274+ maxSystemMemoryUsageBytes = null ;
266275 }
267276 modelBytesExceeded = in .readOptionalLong ();
268277 modelBytesMemoryLimit = in .readOptionalLong ();
@@ -305,8 +314,9 @@ public void writeTo(StreamOutput out) throws IOException {
305314 out .writeString (jobId );
306315 out .writeVLong (modelBytes );
307316 out .writeOptionalLong (peakModelBytes );
308- if (out .getTransportVersion ().onOrAfter (TransportVersions .ML_AD_ACTUAL_MEMORY_USAGE )) {
309- out .writeOptionalLong (actualMemoryUsageBytes );
317+ if (out .getTransportVersion ().onOrAfter (TransportVersions .ML_AD_SYSTEM_MEMORY_USAGE )) {
318+ out .writeOptionalLong (systemMemoryUsageBytes );
319+ out .writeOptionalLong (maxSystemMemoryUsageBytes );
310320 }
311321 out .writeOptionalLong (modelBytesExceeded );
312322 out .writeOptionalLong (modelBytesMemoryLimit );
@@ -354,8 +364,11 @@ public XContentBuilder doXContentBody(XContentBuilder builder) throws IOExceptio
354364 if (peakModelBytes != null ) {
355365 builder .field (PEAK_MODEL_BYTES_FIELD .getPreferredName (), peakModelBytes );
356366 }
357- if (actualMemoryUsageBytes != null ) {
358- builder .field (ACTUAL_MEMORY_USAGE_BYTES .getPreferredName (), actualMemoryUsageBytes );
367+ if (systemMemoryUsageBytes != null ) {
368+ builder .field (SYSTEM_MEMORY_BYTES .getPreferredName (), systemMemoryUsageBytes );
369+ }
370+ if (maxSystemMemoryUsageBytes != null ) {
371+ builder .field (MAX_SYSTEM_MEMORY_BYTES .getPreferredName (), maxSystemMemoryUsageBytes );
359372 }
360373 if (modelBytesExceeded != null ) {
361374 builder .field (MODEL_BYTES_EXCEEDED_FIELD .getPreferredName (), modelBytesExceeded );
@@ -409,8 +422,12 @@ public Long getPeakModelBytes() {
409422 return peakModelBytes ;
410423 }
411424
412- public Long getActualMemoryUsageBytes () {
413- return actualMemoryUsageBytes ;
425+ public Long getSystemMemoryBytes () {
426+ return systemMemoryUsageBytes ;
427+ }
428+
429+ public Long getMaxSystemMemoryBytes () {
430+ return maxSystemMemoryUsageBytes ;
414431 }
415432
416433 public Long getModelBytesExceeded () {
@@ -501,7 +518,8 @@ public int hashCode() {
501518 jobId ,
502519 modelBytes ,
503520 peakModelBytes ,
504- actualMemoryUsageBytes ,
521+ systemMemoryUsageBytes ,
522+ maxSystemMemoryUsageBytes ,
505523 modelBytesExceeded ,
506524 modelBytesMemoryLimit ,
507525 totalByFieldCount ,
@@ -540,7 +558,8 @@ public boolean equals(Object other) {
540558
541559 return this .modelBytes == that .modelBytes
542560 && Objects .equals (this .peakModelBytes , that .peakModelBytes )
543- && this .actualMemoryUsageBytes == that .actualMemoryUsageBytes
561+ && this .systemMemoryUsageBytes == that .systemMemoryUsageBytes
562+ && this .maxSystemMemoryUsageBytes == that .maxSystemMemoryUsageBytes
544563 && Objects .equals (this .modelBytesExceeded , that .modelBytesExceeded )
545564 && Objects .equals (this .modelBytesMemoryLimit , that .modelBytesMemoryLimit )
546565 && this .totalByFieldCount == that .totalByFieldCount
@@ -567,7 +586,8 @@ public static class Builder {
567586 private final String jobId ;
568587 private long modelBytes ;
569588 private Long peakModelBytes ;
570- private Long actualMemoryUsageBytes ;
589+ private Long systemMemoryUsageBytes ;
590+ private Long maxSystemMemoryUsageBytes ;
571591 private Long modelBytesExceeded ;
572592 private Long modelBytesMemoryLimit ;
573593 private long totalByFieldCount ;
@@ -598,7 +618,8 @@ public Builder(ModelSizeStats modelSizeStats) {
598618 this .jobId = modelSizeStats .jobId ;
599619 this .modelBytes = modelSizeStats .modelBytes ;
600620 this .peakModelBytes = modelSizeStats .peakModelBytes ;
601- this .actualMemoryUsageBytes = modelSizeStats .actualMemoryUsageBytes ;
621+ this .systemMemoryUsageBytes = modelSizeStats .systemMemoryUsageBytes ;
622+ this .maxSystemMemoryUsageBytes = modelSizeStats .maxSystemMemoryUsageBytes ;
602623 this .modelBytesExceeded = modelSizeStats .modelBytesExceeded ;
603624 this .modelBytesMemoryLimit = modelSizeStats .modelBytesMemoryLimit ;
604625 this .totalByFieldCount = modelSizeStats .totalByFieldCount ;
@@ -629,8 +650,13 @@ public Builder setPeakModelBytes(long peakModelBytes) {
629650 return this ;
630651 }
631652
632- public Builder setActualMemoryUsageBytes (long actualMemoryUsageBytes ) {
633- this .actualMemoryUsageBytes = actualMemoryUsageBytes ;
653+ public Builder setSystemMemoryBytes (long systemMemoryUsageBytes ) {
654+ this .systemMemoryUsageBytes = systemMemoryUsageBytes ;
655+ return this ;
656+ }
657+
658+ public Builder setMaxSystemMemoryBytes (long maxSystemMemoryUsageBytes ) {
659+ this .maxSystemMemoryUsageBytes = maxSystemMemoryUsageBytes ;
634660 return this ;
635661 }
636662
@@ -731,7 +757,8 @@ public ModelSizeStats build() {
731757 jobId ,
732758 modelBytes ,
733759 peakModelBytes ,
734- actualMemoryUsageBytes ,
760+ systemMemoryUsageBytes ,
761+ maxSystemMemoryUsageBytes ,
735762 modelBytesExceeded ,
736763 modelBytesMemoryLimit ,
737764 totalByFieldCount ,
0 commit comments