Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add analytics to xpack usage #4728

Merged
merged 1 commit into from
Jun 10, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -127,6 +127,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();
}
});
}
}