瀏覽代碼

Add cache stats to cat/nodes.

Closes #4543.
Andrew Raines 11 年之前
父節點
當前提交
fdfc7d7460
共有 1 個文件被更改,包括 9 次插入1 次删除
  1. 9 1
      src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java

+ 9 - 1
src/main/java/org/elasticsearch/rest/action/cat/RestNodesAction.java

@@ -74,7 +74,7 @@ public class RestNodesAction extends AbstractCatAction {
                     @Override
                     public void onResponse(final NodesInfoResponse nodesInfoResponse) {
                         NodesStatsRequest nodesStatsRequest = new NodesStatsRequest();
-                        nodesStatsRequest.clear().jvm(true).os(true).fs(true);
+                        nodesStatsRequest.clear().jvm(true).os(true).fs(true).indices(true);
                         client.admin().cluster().nodesStats(nodesStatsRequest, new ActionListener<NodesStatsResponse>() {
                             @Override
                             public void onResponse(NodesStatsResponse nodesStatsResponse) {
@@ -136,6 +136,10 @@ public class RestNodesAction extends AbstractCatAction {
         table.addCell("ramPercent", "text-align:right;desc:used machine memory ratio");
         table.addCell("ramMax", "default:false;text-align:right;desc:total machine memory");
 
+        table.addCell("fielddata", "default:false;text-align:right;desc:used fielddata cache");
+        table.addCell("filter", "default:false;text-align:right;desc:used filter cache");
+        table.addCell("idCache", "default:false;text-align:right;desc:used id cache");
+
         table.addCell("load", "text-align:right;desc:most recent load avg");
         table.addCell("uptime", "default:false;text-align:right;desc:node uptime");
         table.addCell("data/client", "desc:d:data node, c:client node");
@@ -171,6 +175,10 @@ public class RestNodesAction extends AbstractCatAction {
             table.addCell(stats == null ? null : stats.getOs().mem() == null ? null : stats.getOs().mem().usedPercent());
             table.addCell(info == null ? null : info.getOs().mem() == null ? null : info.getOs().mem().total()); // sigar fails to load in IntelliJ
 
+            table.addCell(stats == null ? null : stats.getIndices().getFieldData().getMemorySize());
+            table.addCell(stats == null ? null : stats.getIndices().getFilterCache().getMemorySize());
+            table.addCell(stats == null ? null : stats.getIndices().getIdCache().getMemorySize());
+
             table.addCell(stats == null ? null : stats.getOs() == null ? null : stats.getOs().getLoadAverage().length < 1 ? null : String.format(Locale.ROOT, "%.2f", stats.getOs().getLoadAverage()[0]));
             table.addCell(stats == null ? null : stats.getJvm().uptime());
             table.addCell(node.clientNode() ? "c" : node.dataNode() ? "d" : "-");