diff --git a/core/src/main/java/org/elasticsearch/rest/action/cat/RestThreadPoolAction.java b/core/src/main/java/org/elasticsearch/rest/action/cat/RestThreadPoolAction.java index 880995ec5da..dc8c2d773e3 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/cat/RestThreadPoolAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/cat/RestThreadPoolAction.java @@ -30,9 +30,9 @@ import org.elasticsearch.action.admin.cluster.state.ClusterStateResponse; import org.elasticsearch.client.node.NodeClient; import org.elasticsearch.cluster.node.DiscoveryNode; import org.elasticsearch.cluster.node.DiscoveryNodes; -import org.elasticsearch.common.Strings; import org.elasticsearch.common.Table; import org.elasticsearch.common.inject.Inject; +import org.elasticsearch.common.regex.Regex; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.transport.InetSocketTransportAddress; import org.elasticsearch.rest.RestChannel; @@ -47,75 +47,26 @@ import org.elasticsearch.threadpool.ThreadPoolStats; import java.util.Collections; import java.util.HashMap; -import java.util.LinkedHashSet; +import java.util.HashSet; import java.util.Map; import java.util.Set; +import java.util.TreeMap; import static org.elasticsearch.rest.RestRequest.Method.GET; public class RestThreadPoolAction extends AbstractCatAction { - private static final String[] SUPPORTED_NAMES = new String[]{ - ThreadPool.Names.BULK, - ThreadPool.Names.FLUSH, - ThreadPool.Names.GENERIC, - ThreadPool.Names.GET, - ThreadPool.Names.INDEX, - ThreadPool.Names.MANAGEMENT, - ThreadPool.Names.FORCE_MERGE, - ThreadPool.Names.REFRESH, - ThreadPool.Names.SEARCH, - ThreadPool.Names.SNAPSHOT, - ThreadPool.Names.WARMER - }; - - private static final String[] SUPPORTED_ALIASES = new String[]{ - "b", - "f", - "ge", - "g", - "i", - "ma", - "fm", - "r", - "s", - "sn", - "w" - }; - - static { - assert SUPPORTED_ALIASES.length == SUPPORTED_NAMES.length: "SUPPORTED_NAMES/ALIASES mismatch"; - } - - private static final String[] DEFAULT_THREAD_POOLS = new String[]{ - ThreadPool.Names.BULK, - ThreadPool.Names.INDEX, - ThreadPool.Names.SEARCH, - }; - - private static final Map ALIAS_TO_THREAD_POOL; - private static final Map THREAD_POOL_TO_ALIAS; - - static { - ALIAS_TO_THREAD_POOL = new HashMap<>(SUPPORTED_NAMES.length); - for (String supportedThreadPool : SUPPORTED_NAMES) { - ALIAS_TO_THREAD_POOL.put(supportedThreadPool.substring(0, 3), supportedThreadPool); - } - THREAD_POOL_TO_ALIAS = new HashMap<>(SUPPORTED_NAMES.length); - for (int i = 0; i < SUPPORTED_NAMES.length; i++) { - THREAD_POOL_TO_ALIAS.put(SUPPORTED_NAMES[i], SUPPORTED_ALIASES[i]); - } - } - @Inject public RestThreadPoolAction(Settings settings, RestController controller) { super(settings); controller.registerHandler(GET, "/_cat/thread_pool", this); + controller.registerHandler(GET, "/_cat/thread_pool/{thread_pool_patterns}", this); } @Override protected void documentation(StringBuilder sb) { sb.append("/_cat/thread_pool\n"); + sb.append("/_cat/thread_pool/{thread_pools}"); } @Override @@ -149,96 +100,55 @@ public class RestThreadPoolAction extends AbstractCatAction { @Override protected Table getTableWithHeader(final RestRequest request) { - Table table = new Table(); + final Table table = new Table(); table.startHeaders(); - table.addCell("id", "default:false;alias:nodeId;desc:unique node id"); + table.addCell("node_name", "default:true;alias:nn;desc:node name"); + table.addCell("node_id", "default:false;alias:id;desc:persistent node id"); + table.addCell("ephemeral_node_id", "default:false;alias:eid;desc:ephemeral node id"); table.addCell("pid", "default:false;alias:p;desc:process id"); - table.addCell("host", "alias:h;desc:host name"); - table.addCell("ip", "alias:i;desc:ip address"); + table.addCell("host", "default:false;alias:h;desc:host name"); + table.addCell("ip", "default:false;alias:i;desc:ip address"); table.addCell("port", "default:false;alias:po;desc:bound transport port"); - - final String[] requestedPools = fetchSortedPools(request, DEFAULT_THREAD_POOLS); - for (String pool : SUPPORTED_NAMES) { - String poolAlias = THREAD_POOL_TO_ALIAS.get(pool); - boolean display = false; - for (String requestedPool : requestedPools) { - if (pool.equals(requestedPool)) { - display = true; - break; - } - } - - String defaultDisplayVal = Boolean.toString(display); - table.addCell( - pool + ".type", - "alias:" + poolAlias + "t;default:false;desc:" + pool + " thread pool type" - ); - table.addCell( - pool + ".active", - "alias:" + poolAlias + "a;default:" + defaultDisplayVal + ";text-align:right;desc:number of active " + pool + " threads" - ); - table.addCell( - pool + ".size", - "alias:" + poolAlias + "s;default:false;text-align:right;desc:number of " + pool + " threads" - ); - table.addCell( - pool + ".queue", - "alias:" + poolAlias + "q;default:" + defaultDisplayVal + ";text-align:right;desc:number of " + pool + " threads in queue" - ); - table.addCell( - pool + ".queueSize", - "alias:" + poolAlias + "qs;default:false;text-align:right;desc:maximum number of " + pool + " threads in queue" - ); - table.addCell( - pool + ".rejected", - "alias:" + poolAlias + "r;default:" + defaultDisplayVal + ";text-align:right;desc:number of rejected " + pool + " threads" - ); - table.addCell( - pool + ".largest", - "alias:" + poolAlias + "l;default:false;text-align:right;desc:highest number of seen active " + pool + " threads" - ); - table.addCell( - pool + ".completed", - "alias:" + poolAlias + "c;default:false;text-align:right;desc:number of completed " + pool + " threads" - ); - table.addCell( - pool + ".min", - "alias:" + poolAlias + "mi;default:false;text-align:right;desc:minimum number of " + pool + " threads" - ); - table.addCell( - pool + ".max", - "alias:" + poolAlias + "ma;default:false;text-align:right;desc:maximum number of " + pool + " threads" - ); - table.addCell( - pool + ".keepAlive", - "alias:" + poolAlias + "k;default:false;text-align:right;desc:" + pool + " thread keep alive time" - ); - } - + table.addCell("name", "default:true;alias:n;desc:thread pool name"); + table.addCell("type", "alias:t;default:false;desc:thread pool type"); + table.addCell("active", "alias:a;default:true;text-align:right;desc:number of active threads"); + table.addCell("size", "alias:s;default:false;text-align:right;desc:number of threads"); + table.addCell("queue", "alias:q;default:true;text-align:right;desc:number of tasks currently in queue"); + table.addCell("queue_size", "alias:qs;default:false;text-align:right;desc:maximum number of tasks permitted in queue"); + table.addCell("rejected", "alias:r;default:true;text-align:right;desc:number of rejected tasks"); + table.addCell("largest", "alias:l;default:false;text-align:right;desc:highest number of seen active threads"); + table.addCell("completed", "alias:c;default:false;text-align:right;desc:number of completed tasks"); + table.addCell("min", "alias:mi;default:false;text-align:right;desc:minimum number of threads"); + table.addCell("max", "alias:ma;default:false;text-align:right;desc:maximum number of threads"); + table.addCell("keep_alive", "alias:ka;default:false;text-align:right;desc:thread keep alive time"); table.endHeaders(); return table; } - private Table buildTable(RestRequest req, ClusterStateResponse state, NodesInfoResponse nodesInfo, NodesStatsResponse nodesStats) { - boolean fullId = req.paramAsBoolean("full_id", false); - DiscoveryNodes nodes = state.getState().nodes(); - Table table = getTableWithHeader(req); + final String[] threadPools = req.paramAsStringArray("thread_pool_patterns", new String[] { "*" }); + final DiscoveryNodes nodes = state.getState().nodes(); + final Table table = getTableWithHeader(req); - for (DiscoveryNode node : nodes) { - NodeInfo info = nodesInfo.getNodesMap().get(node.getId()); - NodeStats stats = nodesStats.getNodesMap().get(node.getId()); - table.startRow(); - - table.addCell(fullId ? node.getId() : Strings.substring(node.getId(), 0, 4)); - table.addCell(info == null ? null : info.getProcess().getId()); - table.addCell(node.getHostName()); - table.addCell(node.getHostAddress()); - if (node.getAddress() instanceof InetSocketTransportAddress) { - table.addCell(((InetSocketTransportAddress) node.getAddress()).address().getPort()); - } else { - table.addCell("-"); + // collect all thread pool names that we see across the nodes + final Set candidates = new HashSet<>(); + for (final NodeStats nodeStats : nodesStats.getNodes()) { + for (final ThreadPoolStats.Stats threadPoolStats : nodeStats.getThreadPool()) { + candidates.add(threadPoolStats.getName()); } + } + + // collect all thread pool names that match the specified thread pool patterns + final Set included = new HashSet<>(); + for (final String candidate : candidates) { + if (Regex.simpleMatch(threadPools, candidate)) { + included.add(candidate); + } + } + + for (final DiscoveryNode node : nodes) { + final NodeInfo info = nodesInfo.getNodesMap().get(node.getId()); + final NodeStats stats = nodesStats.getNodesMap().get(node.getId()); final Map poolThreadStats; final Map poolThreadInfo; @@ -247,8 +157,9 @@ public class RestThreadPoolAction extends AbstractCatAction { poolThreadStats = Collections.emptyMap(); poolThreadInfo = Collections.emptyMap(); } else { - poolThreadStats = new HashMap<>(14); - poolThreadInfo = new HashMap<>(14); + // we use a sorted map to ensure that thread pools are sorted by name + poolThreadStats = new TreeMap<>(); + poolThreadInfo = new HashMap<>(); ThreadPoolStats threadPoolStats = stats.getThreadPool(); for (ThreadPoolStats.Stats threadPoolStat : threadPoolStats) { @@ -260,9 +171,25 @@ public class RestThreadPoolAction extends AbstractCatAction { } } } - for (String pool : SUPPORTED_NAMES) { - ThreadPoolStats.Stats poolStats = poolThreadStats.get(pool); - ThreadPool.Info poolInfo = poolThreadInfo.get(pool); + for (Map.Entry entry : poolThreadStats.entrySet()) { + + if (!included.contains(entry.getKey())) continue; + + table.startRow(); + + table.addCell(node.getName()); + table.addCell(node.getId()); + table.addCell(node.getEphemeralId()); + table.addCell(info == null ? null : info.getProcess().getId()); + table.addCell(node.getHostName()); + table.addCell(node.getHostAddress()); + if (node.getAddress() instanceof InetSocketTransportAddress) { + table.addCell(((InetSocketTransportAddress) node.getAddress()).address().getPort()); + } else { + table.addCell("-"); + } + final ThreadPoolStats.Stats poolStats = entry.getValue(); + final ThreadPool.Info poolInfo = poolThreadInfo.get(entry.getKey()); Long maxQueueSize = null; String keepAlive = null; @@ -284,6 +211,7 @@ public class RestThreadPoolAction extends AbstractCatAction { } } + table.addCell(entry.getKey()); table.addCell(poolInfo == null ? null : poolInfo.getThreadPoolType().getType()); table.addCell(poolStats == null ? null : poolStats.getActive()); table.addCell(poolStats == null ? null : poolStats.getThreads()); @@ -295,34 +223,11 @@ public class RestThreadPoolAction extends AbstractCatAction { table.addCell(minThreads); table.addCell(maxThreads); table.addCell(keepAlive); - } - table.endRow(); + table.endRow(); + } } return table; } - - // The thread pool columns should always be in the same order. - private String[] fetchSortedPools(RestRequest request, String[] defaults) { - String[] headers = request.paramAsStringArray("h", null); - if (headers == null) { - return defaults; - } else { - Set requestedPools = new LinkedHashSet<>(headers.length); - for (String header : headers) { - int dotIndex = header.indexOf('.'); - if (dotIndex != -1) { - String headerPrefix = header.substring(0, dotIndex); - if (THREAD_POOL_TO_ALIAS.containsKey(headerPrefix)) { - requestedPools.add(headerPrefix); - } - } else if (ALIAS_TO_THREAD_POOL.containsKey(header)) { - requestedPools.add(ALIAS_TO_THREAD_POOL.get(header)); - } - - } - return requestedPools.toArray(new String[requestedPools.size()]); - } - } } diff --git a/docs/reference/cat/thread_pool.asciidoc b/docs/reference/cat/thread_pool.asciidoc index 1d01989a429..300767c256b 100644 --- a/docs/reference/cat/thread_pool.asciidoc +++ b/docs/reference/cat/thread_pool.asciidoc @@ -2,106 +2,124 @@ == cat thread pool The `thread_pool` command shows cluster wide thread pool statistics per node. By default the active, queue and rejected -statistics are returned for the bulk, index and search thread pools. +statistics are returned for all thread pools. [source,sh] -------------------------------------------------- % curl 192.168.56.10:9200/_cat/thread_pool -host1 192.168.1.35 0 0 0 0 0 0 0 0 0 -host2 192.168.1.36 0 0 0 0 0 0 0 0 0 +0EWUhXe bulk 0 0 0 +0EWUhXe fetch_shard_started 0 0 0 +0EWUhXe fetch_shard_store 0 0 0 +0EWUhXe flush 0 0 0 +0EWUhXe force_merge 0 0 0 +0EWUhXe generic 0 0 0 +0EWUhXe get 0 0 0 +0EWUhXe index 0 0 0 +0EWUhXe listener 0 0 0 +0EWUhXe management 1 0 0 +0EWUhXe refresh 0 0 0 +0EWUhXe search 0 0 0 +0EWUhXe snapshot 0 0 0 +0EWUhXe warmer 0 0 0 -------------------------------------------------- -The first two columns contain the host and ip of a node. +The first column is the node name [source,sh] -------------------------------------------------- -host ip -host1 192.168.1.35 -host2 192.168.1.36 +node_name +0EWUhXe -------------------------------------------------- -The next three columns show the active queue and rejected statistics for the bulk thread pool. +The second column is the thread pool name +[source,sh] +-------------------------------------------------- +name +bulk +fetch_shard_started +fetch_shard_store +flush +force_merge +generic +get +index +listener +management +refresh +search +snapshot +warmer +-------------------------------------------------- + + +The next three columns show the active, queue, and rejected statistics for each thread pool [source,sh] -------------------------------------------------- -bulk.active bulk.queue bulk.rejected - 0 0 0 +active queue rejected + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 1 0 0 + 0 0 0 + 0 0 0 + 0 0 0 + 0 0 0 -------------------------------------------------- -The remaining columns show the active queue and rejected statistics of the index and search thread pool respectively. - -Also other statistics of different thread pools can be retrieved by using the `h` (header) parameter. +The cat thread pool API accepts a `thread_pool_patterns` URL parameter for specifying a +comma-separated list of regular expressions to match thread pool names. [source,sh] -------------------------------------------------- -% curl 'localhost:9200/_cat/thread_pool?v&h=id,host,suggest.active,suggest.rejected,suggest.completed' -host suggest.active suggest.rejected suggest.completed -host1 0 0 0 -host2 0 0 0 +% curl 'localhost:9200/_cat/thread_pool/generic?v&h=id,name,active,rejected,completed' +id name active rejected completed +0EWUhXeBQtaVGlexUeVwMg generic 0 0 70 -------------------------------------------------- -Here the host columns and the active, rejected and completed suggest thread pool statistic are displayed. The suggest -thread pool won't be displayed by default, so you always need to be specific about what statistic you want to display. - -[float] -=== Available Thread Pools - -Currently available <>: - -[cols="<,<,<",options="header"] -|======================================================================= -|Thread Pool |Alias |Description -|`bulk` |`b` |Thread pool used for <> operations -|`flush` |`f` |Thread pool used for <> operations -|`generic` |`ge` |Thread pool used for generic operations (e.g. background node discovery) -|`get` |`g` |Thread pool used for <> operations -|`index` |`i` |Thread pool used for <>/<> operations -|`management` |`ma` |Thread pool used for management of Elasticsearch (e.g. cluster management) -|`force_merge` |`fm` |Thread pool used for <> operations -|`refresh` |`r` |Thread pool used for <> operations -|`search` |`s` |Thread pool used for <>/<> operations -|`snapshot` |`sn` |Thread pool used for <> operations -|`suggest` |`su` |Thread pool used for <> operations -|`warmer` |`w` |Thread pool used for index warm-up operations -|======================================================================= - -The thread pool name (or alias) must be combined with a thread pool field below -to retrieve the requested information. +Here the host columns and the active, rejected and completed suggest thread pool statistic are displayed. +All <> and custom thread pools are available. [float] ==== Thread Pool Fields For each thread pool, you can load details about it by using the field names -in the table below, either using the full field name (e.g. `bulk.active`) or -its alias (e.g. `sa` is equivalent to `search.active`). +in the table below. [cols="<,<,<",options="header"] |======================================================================= |Field Name |Alias |Description -|`type` |`t` |The current (*) type of thread pool (`cached`, `fixed` or `scaling`) +|`type` |`t` |The current (*) type of thread pool (`fixed` or `scaling`) |`active` |`a` |The number of active threads in the current thread pool |`size` |`s` |The number of threads in the current thread pool |`queue` |`q` |The number of tasks in the queue for the current thread pool -|`queueSize` |`qs` |The maximum number of tasks in the queue for the current thread pool -|`rejected` |`r` |The number of rejected threads in the current thread pool +|`queue_size` |`qs` |The maximum number of tasks permitted in the queue for the current thread pool +|`rejected` |`r` |The number of tasks rejected by the thread pool executor |`largest` |`l` |The highest number of active threads in the current thread pool -|`completed` |`c` |The number of completed threads in the current thread pool +|`completed` |`c` |The number of tasks completed by the thread pool executor |`min` |`mi` |The configured minimum number of active threads allowed in the current thread pool |`max` |`ma` |The configured maximum number of active threads allowed in the current thread pool -|`keepAlive` |`k` |The configured keep alive time for threads +|`keep_alive` |`k` |The configured keep alive time for threads |======================================================================= [float] === Other Fields In addition to details about each thread pool, it is also convenient to get an -understanding of where those thread pools reside. As such, you can request +understanding of where those thread pools reside. As such, you can request other details like the `ip` of the responding node(s). [cols="<,<,<",options="header"] |======================================================================= |Field Name |Alias |Description -|`id` |`nodeId` |The unique node ID +|`node_id` |`id` |The unique node ID +|`ephemeral_id`|`eid` |The ephemeral node ID |`pid` |`p` |The process ID of the running node |`host` |`h` |The hostname for the current node |`ip` |`i` |The IP address for the current node diff --git a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json index b291804bbfc..d6ba5ebc6b1 100644 --- a/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json +++ b/rest-api-spec/src/main/resources/rest-api-spec/api/cat.thread_pool.json @@ -4,7 +4,7 @@ "methods": ["GET"], "url": { "path": "/_cat/thread_pool", - "paths": ["/_cat/thread_pool"], + "paths": ["/_cat/thread_pool","/_cat/thread_pool/{thread_pools}"], "parts": { }, "params": { @@ -39,10 +39,9 @@ "description": "Verbose mode. Display column headers", "default": false }, - "full_id": { - "type": "boolean", - "description": "Enables displaying the complete node ids", - "default": false + "thread_pool_patterns": { + "type": "list", + "description": "A comma-separated list of regular-expressions to filter the thread pools in the output" } } }, diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.thread_pool/10_basic.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.thread_pool/10_basic.yaml index b79100664ab..a7d4e6c9901 100755 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.thread_pool/10_basic.yaml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.thread_pool/10_basic.yaml @@ -6,17 +6,17 @@ - match: $body: | - / #host ip bulk.active bulk.queue bulk.rejected index.active index.queue index.rejected search.active search.queue search.rejected - ^ (\S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ + / #node_name name active queue rejected + ^ (\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ - do: cat.thread_pool: v: true - match: - $body: | - /^ host \s+ ip \s+ bulk.active \s+ bulk.queue \s+ bulk.rejected \s+ index.active \s+ index.queue \s+ index.rejected \s+ search.active \s+ search.queue \s+ search.rejected \n - (\S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ + $body: | + /^ node_name \s+ name \s+ active \s+ queue \s+ rejected \n + (\S+ \s+ \S+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ - do: cat.thread_pool: @@ -25,135 +25,56 @@ - match: $body: | / #pid id host ip port - ^ (\d+ \s+ \S{4} \s+ \S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ (\d+|-) \n)+ $/ + (\d+ \s+ \S+ \s+ \S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ (\d+|-) \n)+ $/ - do: cat.thread_pool: - h: id,ba,fa,gea,ga,ia,maa,ma,fma - v: true - full_id: true - - - match: - $body: | - /^ id \s+ ba \s+ fa \s+ gea \s+ ga \s+ ia \s+ maa \s+ fma \n - (\S+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ - - - do: - cat.thread_pool: - h: id,bulk.type,bulk.active,bulk.size,bulk.queue,bulk.queueSize,bulk.rejected,bulk.largest,bulk.completed,bulk.min,bulk.max,bulk.keepAlive + thread_pool_patterns: bulk,management,flush,index,generic,force_merge + h: id,name,active v: true - match: $body: | - /^ id \s+ bulk.type \s+ bulk.active \s+ bulk.size \s+ bulk.queue \s+ bulk.queueSize \s+ bulk.rejected \s+ bulk.largest \s+ bulk.completed \s+ bulk.min \s+ bulk.max \s+ bulk.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ + /^ id \s+ name \s+ active \n + (\S+\s+ bulk \s+ \d+ \n + \S+\s+ flush \s+ \d+ \n + \S+\s+ force_merge \s+ \d+ \n + \S+\s+ generic \s+ \d+ \n + \S+\s+ index \s+ \d+ \n + \S+\s+ management \s+ \d+ \n)+ $/ - do: cat.thread_pool: - h: id,flush.type,flush.active,flush.size,flush.queue,flush.queueSize,flush.rejected,flush.largest,flush.completed,flush.min,flush.max,flush.keepAlive + thread_pool_patterns: bulk + h: id,name,type,active,size,queue,queue_size,rejected,largest,completed,min,max,keep_alive v: true - match: $body: | - /^ id \s+ flush.type \s+ flush.active \s+ flush.size \s+ flush.queue \s+ flush.queueSize \s+ flush.rejected \s+ flush.largest \s+ flush.completed \s+ flush.min \s+ flush.max \s+ flush.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ + /^ id \s+ name \s+ type \s+ active \s+ size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ min \s+ max \s+ keep_alive \n + (\S+ \s+ bulk \s+ fixed \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - do: cat.thread_pool: - h: id,generic.type,generic.active,generic.size,generic.queue,generic.queueSize,generic.rejected,generic.largest,generic.completed,generic.min,generic.max,generic.keepAlive + thread_pool_patterns: fetch* + h: id,name,type,active,size,queue,queue_size,rejected,largest,completed,min,max,keep_alive v: true - match: $body: | - /^ id \s+ generic.type \s+ generic.active \s+ generic.size \s+ generic.queue \s+ generic.queueSize \s+ generic.rejected \s+ generic.largest \s+ generic.completed \s+ generic.min \s+ generic.max \s+ generic.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - h: id,get.type,get.active,get.size,get.queue,get.queueSize,get.rejected,get.largest,get.completed,get.min,get.max,get.keepAlive - v: true - - - match: - $body: | - /^ id \s+ get.type \s+ get.active \s+ get.size \s+ get.queue \s+ get.queueSize \s+ get.rejected \s+ get.largest \s+ get.completed \s+ get.min \s+ get.max \s+ get.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - h: id,index.type,index.active,index.size,index.queue,index.queueSize,index.rejected,index.largest,index.completed,index.min,index.max,index.keepAlive - v: true - - - match: - $body: | - /^ id \s+ index.type \s+ index.active \s+ index.size \s+ index.queue \s+ index.queueSize \s+ index.rejected \s+ index.largest \s+ index.completed \s+ index.min \s+ index.max \s+ index.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - h: id,management.type,management.active,management.size,management.queue,management.queueSize,management.rejected,management.largest,management.completed,management.min,management.max,management.keepAlive - v: true - - - match: - $body: | - /^ id \s+ management.type \s+ management.active \s+ management.size \s+ management.queue \s+ management.queueSize \s+ management.rejected \s+ management.largest \s+ management.completed \s+ management.min \s+ management.max \s+ management.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - h: id,force_merge.type,force_merge.active,force_merge.size,force_merge.queue,force_merge.queueSize,force_merge.rejected,force_merge.largest,force_merge.completed,force_merge.min,force_merge.max,force_merge.keepAlive - v: true - - - match: - $body: | - /^ id \s+ force_merge.type \s+ force_merge.active \s+ force_merge.size \s+ force_merge.queue \s+ force_merge.queueSize \s+ force_merge.rejected \s+ force_merge.largest \s+ force_merge.completed \s+ force_merge.min \s+ force_merge.max \s+ force_merge.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - h: id,refresh.type,refresh.active,refresh.size,refresh.queue,refresh.queueSize,refresh.rejected,refresh.largest,refresh.completed,refresh.min,refresh.max,refresh.keepAlive - v: true - - - match: - $body: | - /^ id \s+ refresh.type \s+ refresh.active \s+ refresh.size \s+ refresh.queue \s+ refresh.queueSize \s+ refresh.rejected \s+ refresh.largest \s+ refresh.completed \s+ refresh.min \s+ refresh.max \s+ refresh.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - h: id,search.type,search.active,search.size,search.queue,search.queueSize,search.rejected,search.largest,search.completed,search.min,search.max,search.keepAlive - v: true - - - match: - $body: | - /^ id \s+ search.type \s+ search.active \s+ search.size \s+ search.queue \s+ search.queueSize \s+ search.rejected \s+ search.largest \s+ search.completed \s+ search.min \s+ search.max \s+ search.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - h: id,snapshot.type,snapshot.active,snapshot.size,snapshot.queue,snapshot.queueSize,snapshot.rejected,snapshot.largest,snapshot.completed,snapshot.min,snapshot.max,snapshot.keepAlive - v: true - - - match: - $body: | - /^ id \s+ snapshot.type \s+ snapshot.active \s+ snapshot.size \s+ snapshot.queue \s+ snapshot.queueSize \s+ snapshot.rejected \s+ snapshot.largest \s+ snapshot.completed \s+ snapshot.min \s+ snapshot.max \s+ snapshot.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - - - do: - cat.thread_pool: - h: id,warmer.type,warmer.active,warmer.size,warmer.queue,warmer.queueSize,warmer.rejected,warmer.largest,warmer.completed,warmer.min,warmer.max,warmer.keepAlive - v: true - - - match: - $body: | - /^ id \s+ warmer.type \s+ warmer.active \s+ warmer.size \s+ warmer.queue \s+ warmer.queueSize \s+ warmer.rejected \s+ warmer.largest \s+ warmer.completed \s+ warmer.min \s+ warmer.max \s+ warmer.keepAlive \n - (\S+ \s+ (cached|fixed|scaling)? \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ + /^ id \s+ name \s+ type \s+ active \s+ size \s+ queue \s+ queue_size \s+ rejected \s+ largest \s+ completed \s+ min \s+ max \s+ keep_alive \n + (\S+ \s+ fetch_shard_started \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n + \S+ \s+ fetch_shard_store \s+ scaling \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d* \s+ \d* \s+ \S* \n)+ $/ - do: cat.thread_pool: + thread_pool_patterns: bulk,index,search size: "" - match: $body: | - / #host ip bulk.active bulk.queue bulk.rejected index.active index.queue index.rejected search.active search.queue search.rejected - ^ (\S+ \s+ (\d{1,3}\.){3}\d{1,3} \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/ + / #node_name name active queue rejected + ^ (\S+ \s+ bulk \s+ \d+ \s+ \d+ \s+ \d+ \n + \S+ \s+ index \s+ \d+ \s+ \d+ \s+ \d+ \n + \S+ \s+ search \s+ \d+ \s+ \d+ \s+ \d+ \n)+ $/