Browse Source

Add scroll stats to cat API

Adds scroll stats at the node, shard and index levels to the cat API.

Closes #12330
Jason Tedor 10 years ago
parent
commit
8637784a2a

+ 18 - 0
core/src/main/java/org/elasticsearch/rest/action/cat/RestIndicesAction.java

@@ -250,6 +250,15 @@ public class RestIndicesAction extends AbstractCatAction {
         table.addCell("search.query_total", "sibling:pri;alias:sqto,searchQueryTotal;default:false;text-align:right;desc:total query phase ops");
         table.addCell("pri.search.query_total", "default:false;text-align:right;desc:total query phase ops");
 
+        table.addCell("search.scroll_current", "sibling:pri;alias:scc,searchScrollCurrent;default:false;text-align:right;desc:open scroll contexts");
+        table.addCell("pri.search.scroll_current", "default:false;text-align:right;desc:open scroll contexts");
+
+        table.addCell("search.scroll_time", "sibling:pri;alias:scti,searchScrollTime;default:false;text-align:right;desc:time scroll contexts held open");
+        table.addCell("pri.search.scroll_time", "default:false;text-align:right;desc:time scroll contexts held open");
+
+        table.addCell("search.scroll_total", "sibling:pri;alias:scto,searchScrollTotal;default:false;text-align:right;desc:completed scroll contexts");
+        table.addCell("pri.search.scroll_total", "default:false;text-align:right;desc:completed scroll contexts");
+
         table.addCell("segments.count", "sibling:pri;alias:sc,segmentsCount;default:false;text-align:right;desc:number of segments");
         table.addCell("pri.segments.count", "default:false;text-align:right;desc:number of segments");
 
@@ -449,6 +458,15 @@ public class RestIndicesAction extends AbstractCatAction {
             table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getQueryCount());
             table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getQueryCount());
 
+            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getScrollCurrent());
+            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getScrollCurrent());
+
+            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getScrollTime());
+            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getScrollTime());
+
+            table.addCell(indexStats == null ? null : indexStats.getTotal().getSearch().getTotal().getScrollCount());
+            table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSearch().getTotal().getScrollCount());
+
             table.addCell(indexStats == null ? null : indexStats.getTotal().getSegments().getCount());
             table.addCell(indexStats == null ? null : indexStats.getPrimaries().getSegments().getCount());
 

+ 6 - 0
core/src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java

@@ -190,6 +190,9 @@ public class RestNodesAction extends AbstractCatAction {
         table.addCell("search.query_current", "alias:sqc,searchQueryCurrent;default:false;text-align:right;desc:current query phase ops");
         table.addCell("search.query_time", "alias:sqti,searchQueryTime;default:false;text-align:right;desc:time spent in query phase");
         table.addCell("search.query_total", "alias:sqto,searchQueryTotal;default:false;text-align:right;desc:total query phase ops");
+        table.addCell("search.scroll_current", "alias:scc,searchScrollCurrent;default:false;text-align:right;desc:open scroll contexts");
+        table.addCell("search.scroll_time", "alias:scti,searchScrollTime;default:false;text-align:right;desc:time scroll contexts held open");
+        table.addCell("search.scroll_total", "alias:scto,searchScrollTotal;default:false;text-align:right;desc:completed scroll contexts");
 
         table.addCell("segments.count", "alias:sc,segmentsCount;default:false;text-align:right;desc:number of segments");
         table.addCell("segments.memory", "alias:sm,segmentsMemory;default:false;text-align:right;desc:memory used by segments");
@@ -322,6 +325,9 @@ public class RestNodesAction extends AbstractCatAction {
             table.addCell(searchStats == null ? null : searchStats.getTotal().getQueryCurrent());
             table.addCell(searchStats == null ? null : searchStats.getTotal().getQueryTime());
             table.addCell(searchStats == null ? null : searchStats.getTotal().getQueryCount());
+            table.addCell(searchStats == null ? null : searchStats.getTotal().getScrollCurrent());
+            table.addCell(searchStats == null ? null : searchStats.getTotal().getScrollTime());
+            table.addCell(searchStats == null ? null : searchStats.getTotal().getScrollCount());
 
             SegmentsStats segmentsStats = indicesStats == null ? null : indicesStats.getSegments();
             table.addCell(segmentsStats == null ? null : segmentsStats.getCount());

+ 6 - 0
core/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java

@@ -146,6 +146,9 @@ public class RestShardsAction extends AbstractCatAction {
         table.addCell("search.query_current", "alias:sqc,searchQueryCurrent;default:false;text-align:right;desc:current query phase ops");
         table.addCell("search.query_time", "alias:sqti,searchQueryTime;default:false;text-align:right;desc:time spent in query phase");
         table.addCell("search.query_total", "alias:sqto,searchQueryTotal;default:false;text-align:right;desc:total query phase ops");
+        table.addCell("search.scroll_current", "alias:scc,searchScrollCurrent;default:false;text-align:right;desc:open scroll contexts");
+        table.addCell("search.scroll_time", "alias:scti,searchScrollTime;default:false;text-align:right;desc:time scroll contexts held open");
+        table.addCell("search.scroll_total", "alias:scto,searchScrollTotal;default:false;text-align:right;desc:completed scroll contexts");
 
         table.addCell("segments.count", "alias:sc,segmentsCount;default:false;text-align:right;desc:number of segments");
         table.addCell("segments.memory", "alias:sm,segmentsMemory;default:false;text-align:right;desc:memory used by segments");
@@ -277,6 +280,9 @@ public class RestShardsAction extends AbstractCatAction {
             table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getQueryCurrent());
             table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getQueryTime());
             table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getQueryCount());
+            table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getScrollCurrent());
+            table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getScrollTime());
+            table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getScrollCount());
 
             table.addCell(shardStats == null ? null : shardStats.getSegments().getCount());
             table.addCell(shardStats == null ? null : shardStats.getSegments().getMemory());

+ 3 - 0
docs/reference/cat/nodes.asciidoc

@@ -182,6 +182,9 @@ phase operations |0
 phase |43ms
 |`search.query_total` |`sqto`, `searchFetchTotal` |No |Number of query
 operations |9
+|`search.scroll_current` |`scc`, `searchScrollCurrent` |No |Open scroll contexts |2
+|`search.scroll_time` |`scti`, `searchScrollTime` |No |Time scroll contexts held open|2m
+|`search.scroll_total` |`scto`, `searchScrollTotal` |No |Completed scroll contexts |1
 |`segments.count` |`sc`, `segmentsCount` |No |Number of segments |4
 |`segments.memory` |`sm`, `segmentsMemory` |No |Memory used by
 segments |1.4kb

+ 3 - 0
rest-api-spec/src/main/resources/rest-api-spec/test/cat.shards/10_basic.yaml

@@ -60,6 +60,9 @@
                     search.query_current             .+   \n
                     search.query_time                .+   \n
                     search.query_total               .+   \n
+                    search.scroll_current            .+   \n
+                    search.scroll_time               .+   \n
+                    search.scroll_total              .+   \n
                     segments.count                   .+   \n
                     segments.memory                  .+   \n
                     segments.index_writer_memory     .+   \n