Skip to content

Commit

Permalink
Add analytics to xpack usage (#4728) (#4753)
Browse files Browse the repository at this point in the history
Relates: #4718
Added in Elasticsearch 7.8.0

Co-authored-by: Russ Cam <[email protected]>
  • Loading branch information
github-actions[bot] and russcam authored Jun 10, 2020
1 parent 2c8347a commit aa2fab2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/Nest/XPack/Info/XPackUsage/XPackUsageResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,18 @@ public class XPackUsageResponse : ResponseBase

[DataMember(Name = "enrich")]
public XPackUsage Enrich { get; set; }

[DataMember(Name = "spatial")]
public XPackUsage Spatial { get; internal set; }

[DataMember(Name = "analytics")]
public AnalyticsUsage Analytics { get; internal set; }
}

public class AnalyticsUsage : XPackUsage
{
[DataMember(Name = "stats")]
public IReadOnlyDictionary<string, long> Stats { get; internal set; } = EmptyReadOnly<string, long>.Dictionary;
}

public class SlmUsage : XPackUsage
Expand Down
6 changes: 6 additions & 0 deletions tests/Tests/XPack/Info/XPackInfoApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,12 @@ [I] public async Task XPackUsageResponse() => await Assert<XPackUsageResponse>(X
{
r.Enrich.Should().NotBeNull();
}

if (TestConfiguration.Instance.InRange(">=7.8.0"))
{
r.Analytics.Should().NotBeNull();
r.Analytics.Stats.Should().NotBeNull().And.NotBeEmpty();
}
});
}
}

0 comments on commit aa2fab2

Please sign in to comment.