Skip to content
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
19 changes: 17 additions & 2 deletions src/Nest/Cluster/NodesStats/NodeStats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,7 @@ public class NodeStats
/// Available in Elasticsearch 7.8.0+
/// </summary>
[DataMember(Name = "script_cache")]
[JsonFormatter(typeof(VerbatimInterfaceReadOnlyDictionaryKeysFormatter<string, ScriptStats>))]
public IReadOnlyDictionary<string, ScriptStats> ScriptCache { get; internal set; }
public ScriptCacheStats ScriptCache { get; internal set; }

[DataMember(Name = "thread_pool")]
[JsonFormatter(typeof(VerbatimInterfaceReadOnlyDictionaryKeysFormatter<string, ThreadCountStats>))]
Expand All @@ -83,6 +82,22 @@ public class NodeStats
public string TransportAddress { get; internal set; }
}

[DataContract]
public class ScriptCacheStats
{
[DataMember(Name = "sum")]
public ScriptStats Sum { get; internal set; }

[DataMember(Name = "contexts")]
public IReadOnlyCollection<ContextScriptStats> Contexts { get; internal set; }
}

[DataContract]
public class ContextScriptStats : ScriptStats
{
[DataMember(Name = "context")]
public string Context { get; internal set; }
}

[DataContract]
public class ScriptStats
Expand Down
5 changes: 4 additions & 1 deletion tests/Tests/Cluster/NodesStats/NodesStatsApiTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,11 @@ protected void Assert(ProcessStats process)

protected void Assert(ScriptStats script) => script.Should().NotBeNull();

protected void Assert(IReadOnlyDictionary<string, ScriptStats> scriptCache) =>
protected void Assert(ScriptCacheStats scriptCache)
{
scriptCache.Should().NotBeNull();
scriptCache.Sum.Should().NotBeNull();
}

protected void Assert(TransportStats transport) => transport.Should().NotBeNull();

Expand Down