### Description

From the nodes stats API, we should extract the `thread_pool` stats into their own endpoint. This endpoint can then be non-node-centric, and present a global view of the number of completed, rejected, and failed operations for each of the threadpools in the system.
server/src/test/java/org/elasticsearch/action/admin/cluster/node/stats/NodeStatsTests.java
compilations += generatedStats.getCompilations();
                        assertEquals(generatedStats.getCompilations(), deserStats.getCompilations());
                    }
                    ScriptStats sum = deserializedScriptCacheStats.sum();
                    assertEquals(evictions, sum.getCacheEvictions());
                    assertEquals(limited, sum.getCompilationLimitTriggered());
                    assertEquals(compilations, sum.getCompilations());
                }
            }
        }
    }
    public void testChunking() {
        assertChunkCount(
            createNodeStats(),
            randomFrom(ToXContent.EMPTY_PARAMS, new ToXContent.MapParams(Map.of("level", "node"))),
            nodeStats -> expectedChunks(nodeStats, NodeStatsLevel.NODE)
        );
        assertChunkCount(
            createNodeStats(),
            new ToXContent.MapParams(Map.of("level", "indices")),
            nodeStats -> expectedChunks(nodeStats, NodeStatsLevel.INDICES)
        );
        assertChunkCount(
            createNodeStats(),
            new ToXContent.MapParams(Map.of("level", "shards")),
            nodeStats -> expectedChunks(nodeStats, NodeStatsLevel.SHARDS)
        );
    }
    private static int expectedChunks(NodeStats nodeStats, NodeStatsLevel level) {
        return 5