### 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
List<ScriptContextStats> deserialized = deserializedScriptStats.getContextStats();
                    long evictions = 0;
                    long limited = 0;
                    long compilations = 0;
                    List<ScriptContextStats> stats = scriptStats.getContextStats();
                    for (ScriptContextStats generatedStats : stats) {
                        List<ScriptContextStats> maybeDeserStats = deserialized.stream()
                            .filter(s -> s.getContext().equals(generatedStats.getContext()))
                            .toList();
                        assertEquals(1, maybeDeserStats.size());
                        ScriptContextStats deserStats = maybeDeserStats.get(0);
                        evictions += generatedStats.getCacheEvictions();
                        assertEquals(generatedStats.getCacheEvictions(), deserStats.getCacheEvictions());
                        limited += generatedStats.getCompilationLimitTriggered();
                        assertEquals(generatedStats.getCompilationLimitTriggered(), deserStats.getCompilationLimitTriggered());
                        compilations += generatedStats.getCompilations();
                        assertEquals(generatedStats.getCompilations(), deserStats.getCompilations());
                        assertEquals(generatedStats.getCacheEvictions(), deserStats.getCacheEvictions());
                        assertEquals(generatedStats.getCompilations(), deserStats.getCompilations());
                    }
                    assertEquals(evictions, scriptStats.getCacheEvictions());
                    assertEquals(limited, scriptStats.getCompilationLimitTriggered());
                    assertEquals(compilations, scriptStats.getCompilations());
                }
                DiscoveryStats discoveryStats = nodeStats.getDiscoveryStats();
                DiscoveryStats deserializedDiscoveryStats = deserializedNodeStats.getDiscoveryStats();
                if (discoveryStats == null) {
                    assertNull(deserializedDiscoveryStats);
                } else {
                    PendingClusterStateStats queueStats = discoveryStats.getQueueStats();