Skip to content

Commit

Permalink
CONSOLEify remaining _cat docs
Browse files Browse the repository at this point in the history
Relates to #18160
  • Loading branch information
nik9000 committed May 4, 2017
1 parent 4862544 commit 45dd378
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 34 deletions.
3 changes: 0 additions & 3 deletions docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ buildRestTests.expectedUnconvertedCandidates = [
'reference/aggregations/metrics/percentile-rank-aggregation.asciidoc',
'reference/aggregations/metrics/scripted-metric-aggregation.asciidoc',
'reference/aggregations/metrics/tophits-aggregation.asciidoc',
'reference/cat/snapshots.asciidoc',
'reference/cat/templates.asciidoc',
'reference/cat/thread_pool.asciidoc',
'reference/cluster/allocation-explain.asciidoc',
'reference/cluster/nodes-info.asciidoc',
'reference/cluster/nodes-stats.asciidoc',
Expand Down
21 changes: 18 additions & 3 deletions docs/reference/cat/snapshots.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,30 @@ The `snapshots` command shows all snapshots that belong to a specific repository
To find a list of available repositories to query, the command `/_cat/repositories` can be used.
Querying the snapshots of a repository named `repo1` then looks as follows.

[source,sh]
[source,js]
--------------------------------------------------
GET /_cat/snapshots/repo1?v&s=id
--------------------------------------------------
// CONSOLE
// TEST[s/^/PUT \/_snapshot\/repo1\/snap1?wait_for_completion=true\n/]
// TEST[s/^/PUT \/_snapshot\/repo1\/snap2?wait_for_completion=true\n/]
// TEST[s/^/PUT \/_snapshot\/repo1\n{"type": "fs", "settings": {"location": "repo\/1"}}\n/]

Which looks like:

[source,txt]
--------------------------------------------------
% curl 'localhost:9200/_cat/snapshots/repo1?v'
id status start_epoch start_time end_epoch end_time duration indices successful_shards failed_shards total_shards
snap1 FAILED 1445616705 18:11:45 1445616978 18:16:18 4.6m 1 4 1 5
snap2 SUCCESS 1445634298 23:04:58 1445634672 23:11:12 6.2m 2 10 0 10
--------------------------------------------------
// TESTRESPONSE[s/FAILED/SUCCESS/ s/14456\d+/\\d+/ s/\d+(\.\d+)?(m|s|ms)/\\d+(\\.\\d+)?(m|s|ms)/]
// TESTRESPONSE[s/\d+:\d+:\d+/\\d+:\\d+:\\d+/]
// TESTRESPONSE[s/1 4 1 5/\\d+ \\d+ \\d+ \\d+/]
// TESTRESPONSE[s/2 10 0 10/\\d+ \\d+ \\d+ \\d+/]
// TESTRESPONSE[_cat]

Each snapshot contains information about when it was started and stopped.
Start and stop timestamps are available in two formats.
The `HH:MM:SS` output is simply for quick human consumption.
The epoch time retains more information, including date, and is machine sortable if the snapshot process spans days.
The epoch time retains more information, including date, and is machine sortable if the snapshot process spans days.
23 changes: 17 additions & 6 deletions docs/reference/cat/templates.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,25 @@

The `templates` command provides information about existing templates.

[source, sh]
[source,js]
--------------------------------------------------
% curl 'localhost:9200/_cat/templates?v=true'
name template order version
template0 te* 0
template1 tea* 1
template2 teak* 2 7
GET /_cat/templates?v&s=name
--------------------------------------------------
// CONSOLE
// TEST[s/^/PUT _template\/template0\n{"index_patterns": "te*", "order": 0}\n/]
// TEST[s/^/PUT _template\/template1\n{"index_patterns": "tea*", "order": 1}\n/]
// TEST[s/^/PUT _template\/template2\n{"index_patterns": "teak*", "order": 2, "version": 7}\n/]

which looks like

[source,txt]
--------------------------------------------------
name index_patterns order version
template0 [te*] 0
template1 [tea*] 1
template2 [teak*] 2 7
--------------------------------------------------
// TESTRESPONSE[s/\*/\\*/ s/\[/\\[/ s/\]/\\]/ _cat]

The output shows that there are three existing templates,
with template2 having a version value.
Expand Down
60 changes: 38 additions & 22 deletions docs/reference/cat/thread_pool.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,43 @@
The `thread_pool` command shows cluster wide thread pool statistics per node. By default the active, queue and rejected
statistics are returned for all thread pools.

[source,sh]
[source,js]
--------------------------------------------------
% curl 192.168.56.10:9200/_cat/thread_pool
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
GET /_cat/thread_pool
--------------------------------------------------
// CONSOLE

Which looks like:

[source,txt]
--------------------------------------------------
node-0 bulk 0 0 0
node-0 fetch_shard_started 0 0 0
node-0 fetch_shard_store 0 0 0
node-0 flush 0 0 0
node-0 force_merge 0 0 0
node-0 generic 0 0 0
node-0 get 0 0 0
node-0 index 0 0 0
node-0 listener 0 0 0
node-0 management 1 0 0
node-0 refresh 0 0 0
node-0 search 0 0 0
node-0 snapshot 0 0 0
node-0 warmer 0 0 0
--------------------------------------------------
// TESTRESPONSE[s/\d+/\\d+/ _cat]

The first column is the node name

[source,sh]
[source,txt]
--------------------------------------------------
node_name
0EWUhXe
node-0
--------------------------------------------------

The second column is the thread pool name
[source,sh]
[source,txt]
--------------------------------------------------
name
bulk
Expand All @@ -54,7 +62,7 @@ warmer

The next three columns show the active, queue, and rejected statistics for each thread pool

[source,sh]
[source,txt]
--------------------------------------------------
active queue rejected
0 0 0
Expand All @@ -76,12 +84,20 @@ active queue rejected
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]
[source,js]
--------------------------------------------------
GET /_cat/thread_pool/generic?v&h=id,name,active,rejected,completed
--------------------------------------------------
// CONSOLE

which looks like:

[source,js]
--------------------------------------------------
% curl 'localhost:9200/_cat/thread_pool/generic?v&h=id,name,active,rejected,completed'
id name active rejected completed
0EWUhXeBQtaVGlexUeVwMg generic 0 0 70
--------------------------------------------------
// TESTRESPONSE[s/0EWUhXeBQtaVGlexUeVwMg/[\\w-]+/ s/\d+/\\d+/ _cat]

Here the host columns and the active, rejected and completed suggest thread pool statistics are displayed.

Expand Down

0 comments on commit 45dd378

Please sign in to comment.