### 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/main/java/org/elasticsearch/threadpool/ThreadPoolStats.java
/*
 * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
 * or more contributor license agreements. Licensed under the Elastic License
 * 2.0 and the Server Side Public License, v 1; you may not use this file except
 * in compliance with, at your election, the Elastic License 2.0 or the Server
 * Side Public License, v 1.
 */
package org.elasticsearch.threadpool;
import org.elasticsearch.common.collect.Iterators;
import org.elasticsearch.common.io.stream.StreamInput;
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.io.stream.Writeable;
import org.elasticsearch.common.xcontent.ChunkedToXContent;
import org.elasticsearch.common.xcontent.ChunkedToXContentHelper;
import org.elasticsearch.xcontent.ToXContent;
import java.io.IOException;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;
import static java.util.Collections.emptyIterator;
import static org.elasticsearch.common.collect.Iterators.single;
public record ThreadPoolStats(List<Stats> stats) implements Writeable, ChunkedToXContent, Iterable<ThreadPoolStats.Stats> {
    public record Stats(String name, int threads, int queue, int active, long rejected, int largest, long completed)
        implements
            Writeable,
            ChunkedToXContent,