Scripting: stats per context in nodes stats (#54008) (#54357)
Adds script cache stats to `_node/stats`.
If using the general cache:
```
"script_cache": {
"sum": {
"compilations": 12,
"cache_evictions": 9,
"compilation_limit_triggered": 5
}
}
```
If using context caches:
```
"script_cache": {
"sum": {
"compilations": 13,
"cache_evictions": 9,
"compilation_limit_triggered": 5
},
"contexts": [
{
"context": "aggregation_selector",
"compilations": 8,
"cache_evictions": 6,
"compilation_limit_triggered": 3
},
{
"context": "aggs",
"compilations": 5,
"cache_evictions": 3,
"compilation_limit_triggered": 2
},
```
Backport of: 32f46f2
Refs: #50152