From 79828fcc9b67ffbfcada383df323852c6779fc73 Mon Sep 17 00:00:00 2001 From: Russ Cam Date: Tue, 30 Jun 2020 09:27:23 +1000 Subject: [PATCH] Add effective max model memory limit to ML info (#4814) Relates: elastic/elasticsearch#55529, #4803 --- .../MachineLearningInfo/MachineLearningInfoResponse.cs | 6 ++++++ .../MachineLearningInfo/MachineLearningInfoApiTests.cs | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/Nest/XPack/MachineLearning/MachineLearningInfo/MachineLearningInfoResponse.cs b/src/Nest/XPack/MachineLearning/MachineLearningInfo/MachineLearningInfoResponse.cs index 22a8800fe00..18eb3680eb6 100644 --- a/src/Nest/XPack/MachineLearning/MachineLearningInfo/MachineLearningInfoResponse.cs +++ b/src/Nest/XPack/MachineLearning/MachineLearningInfo/MachineLearningInfoResponse.cs @@ -62,5 +62,11 @@ public class Limits { [DataMember(Name = "max_model_memory_limit")] public string MaxModelMemoryLimit { get; internal set; } + + /// + /// Available in Elasticsearch 7.8.0+ + /// + [DataMember(Name = "effective_max_model_memory_limit")] + public string EffectiveMaxModelMemoryLimit { get; internal set; } } } diff --git a/tests/Tests/XPack/MachineLearning/MachineLearningInfo/MachineLearningInfoApiTests.cs b/tests/Tests/XPack/MachineLearning/MachineLearningInfo/MachineLearningInfoApiTests.cs index e468f7cd30c..39dff6117b2 100644 --- a/tests/Tests/XPack/MachineLearning/MachineLearningInfo/MachineLearningInfoApiTests.cs +++ b/tests/Tests/XPack/MachineLearning/MachineLearningInfo/MachineLearningInfoApiTests.cs @@ -56,6 +56,9 @@ protected override void ExpectResponse(MachineLearningInfoResponse response) analyzer.Tokenizer.Should().Be("ml_classic"); analyzer.Filter.Should().NotBeNullOrEmpty(); } + + if (TestClient.Configuration.InRange(">=7.8.0")) + response.Limits.EffectiveMaxModelMemoryLimit.Should().NotBeNullOrEmpty(); } } }