File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
src/Nest/Cluster/NodesStats
tests/Tests/Cluster/NodesStats Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -66,8 +66,7 @@ public class NodeStats
6666 /// Available in Elasticsearch 7.8.0+
6767 /// </summary>
6868 [ DataMember ( Name = "script_cache" ) ]
69- [ JsonFormatter ( typeof ( VerbatimInterfaceReadOnlyDictionaryKeysFormatter < string , ScriptStats > ) ) ]
70- public IReadOnlyDictionary < string , ScriptStats > ScriptCache { get ; internal set ; }
69+ public ScriptCacheStats ScriptCache { get ; internal set ; }
7170
7271 [ DataMember ( Name = "thread_pool" ) ]
7372 [ JsonFormatter ( typeof ( VerbatimInterfaceReadOnlyDictionaryKeysFormatter < string , ThreadCountStats > ) ) ]
@@ -83,6 +82,22 @@ public class NodeStats
8382 public string TransportAddress { get ; internal set ; }
8483 }
8584
85+ [ DataContract ]
86+ public class ScriptCacheStats
87+ {
88+ [ DataMember ( Name = "sum" ) ]
89+ public ScriptStats Sum { get ; internal set ; }
90+
91+ [ DataMember ( Name = "contexts" ) ]
92+ public IReadOnlyCollection < ContextScriptStats > Contexts { get ; internal set ; }
93+ }
94+
95+ [ DataContract ]
96+ public class ContextScriptStats : ScriptStats
97+ {
98+ [ DataMember ( Name = "context" ) ]
99+ public string Context { get ; internal set ; }
100+ }
86101
87102 [ DataContract ]
88103 public class ScriptStats
Original file line number Diff line number Diff line change @@ -189,8 +189,11 @@ protected void Assert(ProcessStats process)
189189
190190 protected void Assert ( ScriptStats script ) => script . Should ( ) . NotBeNull ( ) ;
191191
192- protected void Assert ( IReadOnlyDictionary < string , ScriptStats > scriptCache ) =>
192+ protected void Assert ( ScriptCacheStats scriptCache )
193+ {
193194 scriptCache . Should ( ) . NotBeNull ( ) ;
195+ scriptCache . Sum . Should ( ) . NotBeNull ( ) ;
196+ }
194197
195198 protected void Assert ( TransportStats transport ) => transport . Should ( ) . NotBeNull ( ) ;
196199
You can’t perform that action at this time.
0 commit comments