Add rest of index stats to cat/nodes and cat/shards.

Closes #4607.
This commit is contained in:
Andrew Raines 2014-01-06 17:24:31 -06:00
parent 5ca0d47fa4
commit 19e26122a4
2 changed files with 237 additions and 3 deletions

View File

@ -145,6 +145,63 @@ public class RestNodesAction extends AbstractCatAction {
table.addCell("data/client", "desc:d:data node, c:client node");
table.addCell("master", "desc:m:master-eligible, *:current master");
table.addCell("name", "desc:node name");
table.addCell("total.completion.size", "alias:tcs,totalCompletionSize;default:false;text-align:right;desc:size of completion");
table.addCell("total.fielddata.memory_size", "alias:tfm,totalFielddataMemory;default:false;text-align:right;desc:used fielddata cache");
table.addCell("total.fielddata.evictions", "alias:tfe,totalFielddataEvictions;default:false;text-align:right;desc:fielddata evictions");
table.addCell("total.filter_cache.memory_size", "alias:tfcm,totalFilterCacheMemory;default:false;text-align:right;desc:used filter cache");
table.addCell("total.filter_cache.evictions", "alias:tfce,totalFilterCacheEvictions;default:false;text-align:right;desc:filter cache evictions");
table.addCell("total.flush.total", "alias:tft,totalFlushTotal;default:false;text-align:right;desc:number of flushes");
table.addCell("total.flush.total_time", "alias:tftt,totalFlushTotalTime;default:false;text-align:right;desc:time spent in flush");
table.addCell("total.get.current", "alias:tgc,totalGetCurrent;default:false;text-align:right;desc:number of current get ops");
table.addCell("total.get.time", "alias:tgti,totalGetTime;default:false;text-align:right;desc:time spent in get");
table.addCell("total.get.total", "alias:tgto,totalGetTotal;default:false;text-align:right;desc:number of get ops");
table.addCell("total.get.exists_time", "alias:tgeti,totalGetExistsTime;default:false;text-align:right;desc:time spent in successful gets");
table.addCell("total.get.exists_total", "alias:tgeto,totalGetExistsTotal;default:false;text-align:right;desc:number of successful gets");
table.addCell("total.get.missing_time", "alias:tgmti,totalGetMissingTime;default:false;text-align:right;desc:time spent in failed gets");
table.addCell("total.get.missing_total", "alias:tgmto,totalGetMissingTotal;default:false;text-align:right;desc:number of failed gets");
table.addCell("total.id_cache.memory_size", "alias:tim,totalIdCacheMemory;default:false;text-align:right;desc:used id cache");
table.addCell("total.indexing.delete_current", "alias:tidc,totalIndexingDeleteCurrent;default:false;text-align:right;desc:number of current deletions");
table.addCell("total.indexing.delete_time", "alias:tidti,totalIndexingDeleteTime;default:false;text-align:right;desc:time spent in deletions");
table.addCell("total.indexing.delete_total", "alias:tidto,totalIndexingDeleteTotal;default:false;text-align:right;desc:number of delete ops");
table.addCell("total.indexing.index_current", "alias:tiic,totalIndexingIndexCurrent;default:false;text-align:right;desc:number of current indexing ops");
table.addCell("total.indexing.index_time", "alias:tiiti,totalIndexingIndexTime;default:false;text-align:right;desc:time spent in indexing");
table.addCell("total.indexing.index_total", "alias:tiito,totalIndexingIndexTotal;default:false;text-align:right;desc:number of indexing ops");
table.addCell("total.merges.current", "alias:tmc,totalMergesCurrent;default:false;text-align:right;desc:number of current merges");
table.addCell("total.merges.current_docs", "alias:tmcd,totalMergesCurrentDocs;default:false;text-align:right;desc:number of current merging docs");
table.addCell("total.merges.current_size", "alias:tmcs,totalMergesCurrentSize;default:false;text-align:right;desc:size of current merges");
table.addCell("total.merges.total", "alias:tmt,totalMergesTotal;default:false;text-align:right;desc:number of completed merge ops");
table.addCell("total.merges.total_docs", "alias:tmtd,totalMergesTotalDocs;default:false;text-align:right;desc:docs merged");
table.addCell("total.merges.total_size", "alias:tmts,totalMergesTotalSize;default:false;text-align:right;desc:size merged");
table.addCell("total.merges.total_time", "alias:tmtt,totalMergesTotalTime;default:false;text-align:right;desc:time spent in merges");
table.addCell("total.percolate.current", "alias:tpc,totalPercolateCurrent;default:false;text-align:right;desc:number of current percolations");
table.addCell("total.percolate.memory_size", "alias:tpm,totalPercolateMemory;default:false;text-align:right;desc:memory used by percolations");
table.addCell("total.percolate.queries", "alias:tpq,totalPercolateQueries;default:false;text-align:right;desc:number of registered percolation queries");
table.addCell("total.percolate.time", "alias:tpti,totalPercolateTime;default:false;text-align:right;desc:time spent percolating");
table.addCell("total.percolate.total", "alias:tpto,totalPercolateTotal;default:false;text-align:right;desc:total percolations");
table.addCell("total.refresh.total", "alias:trto,totalRefreshTotal;default:false;text-align:right;desc:total refreshes");
table.addCell("total.refresh.time", "alias:trti,totalRefreshTime;default:false;text-align:right;desc:time spent in refreshes");
table.addCell("total.search.fetch_current", "alias:tsfc,totalSearchFetchCurrent;default:false;text-align:right;desc:current fetch phase ops");
table.addCell("total.search.fetch_time", "alias:tsfti,totalSearchFetchTime;default:false;text-align:right;desc:time spent in fetch phase");
table.addCell("total.search.fetch_total", "alias:tsfto,totalSearchFetchTotal;default:false;text-align:right;desc:total fetch ops");
table.addCell("total.search.open_contexts", "alias:tso,totalSearchOpenContexts;default:false;text-align:right;desc:open search contexts");
table.addCell("total.search.query_current", "alias:tsqc,totalSearchQueryCurrent;default:false;text-align:right;desc:current query phase ops");
table.addCell("total.search.query_time", "alias:tsqti,totalSearchQueryTime;default:false;text-align:right;desc:time spent in query phase");
table.addCell("total.search.query_total", "alias:tsqto,totalSearchQueryTotal;default:false;text-align:right;desc:total query phase ops");
table.addCell("total.segments.count", "alias:tsc,totalSegmentsCount;default:false;text-align:right;desc:number of segments");
table.addCell("total.segments.memory", "alias:tsm,totalSegmentsMemory;default:false;text-align:right;desc:memory used by segments");
table.endHeaders();
return table;
}
@ -185,6 +242,62 @@ public class RestNodesAction extends AbstractCatAction {
table.addCell(masterId.equals(node.id()) ? "*" : node.masterNode() ? "m" : "-");
table.addCell(node.name());
table.addCell(stats == null ? null : stats.getIndices().getCompletion().getSize());
table.addCell(stats == null ? null : stats.getIndices().getFieldData().getMemorySize());
table.addCell(stats == null ? null : stats.getIndices().getFieldData().getEvictions());
table.addCell(stats == null ? null : stats.getIndices().getFilterCache().getMemorySize());
table.addCell(stats == null ? null : stats.getIndices().getFilterCache().getEvictions());
table.addCell(stats == null ? null : stats.getIndices().getFlush().getTotal());
table.addCell(stats == null ? null : stats.getIndices().getFlush().getTotalTime());
table.addCell(stats == null ? null : stats.getIndices().getGet().current());
table.addCell(stats == null ? null : stats.getIndices().getGet().getTime());
table.addCell(stats == null ? null : stats.getIndices().getGet().getCount());
table.addCell(stats == null ? null : stats.getIndices().getGet().getExistsTime());
table.addCell(stats == null ? null : stats.getIndices().getGet().getExistsCount());
table.addCell(stats == null ? null : stats.getIndices().getGet().getMissingTime());
table.addCell(stats == null ? null : stats.getIndices().getGet().getMissingCount());
table.addCell(stats == null ? null : stats.getIndices().getIdCache().getMemorySize());
table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getDeleteCurrent());
table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getDeleteTime());
table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getDeleteCount());
table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getIndexCurrent());
table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getIndexTime());
table.addCell(stats == null ? null : stats.getIndices().getIndexing().getTotal().getIndexCount());
table.addCell(stats == null ? null : stats.getIndices().getMerge().getCurrent());
table.addCell(stats == null ? null : stats.getIndices().getMerge().getCurrentNumDocs());
table.addCell(stats == null ? null : stats.getIndices().getMerge().getCurrentSize());
table.addCell(stats == null ? null : stats.getIndices().getMerge().getTotal());
table.addCell(stats == null ? null : stats.getIndices().getMerge().getTotalNumDocs());
table.addCell(stats == null ? null : stats.getIndices().getMerge().getTotalSize());
table.addCell(stats == null ? null : stats.getIndices().getMerge().getTotalTime());
table.addCell(stats == null ? null : stats.getIndices().getPercolate().getCurrent());
table.addCell(stats == null ? null : stats.getIndices().getPercolate().getMemorySize());
table.addCell(stats == null ? null : stats.getIndices().getPercolate().getNumQueries());
table.addCell(stats == null ? null : stats.getIndices().getPercolate().getTime());
table.addCell(stats == null ? null : stats.getIndices().getPercolate().getCount());
table.addCell(stats == null ? null : stats.getIndices().getRefresh().getTotal());
table.addCell(stats == null ? null : stats.getIndices().getRefresh().getTotalTime());
table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getFetchCurrent());
table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getFetchTime());
table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getFetchCount());
table.addCell(stats == null ? null : stats.getIndices().getSearch().getOpenContexts());
table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getQueryCurrent());
table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getQueryTime());
table.addCell(stats == null ? null : stats.getIndices().getSearch().getTotal().getQueryCount());
table.addCell(stats == null ? null : stats.getIndices().getSegments().getCount());
table.addCell(stats == null ? null : stats.getIndices().getSegments().getMemory());
table.endRow();
}

View File

@ -68,7 +68,7 @@ public class RestShardsAction extends AbstractCatAction {
public void onResponse(final ClusterStateResponse clusterStateResponse) {
final String[] concreteIndices = clusterStateResponse.getState().metaData().concreteIndicesIgnoreMissing(indices);
IndicesStatsRequest indicesStatsRequest = new IndicesStatsRequest();
indicesStatsRequest.clear().docs(true).store(true);
indicesStatsRequest.all();
client.admin().indices().stats(indicesStatsRequest, new ActionListener<IndicesStatsResponse>() {
@Override
public void onResponse(IndicesStatsResponse indicesStatsResponse) {
@ -112,8 +112,69 @@ public class RestShardsAction extends AbstractCatAction {
.addCell("docs", "text-align:right;desc:number of docs in shard")
.addCell("store", "text-align:right;desc:store size of shard (how much disk it uses)")
.addCell("ip", "default:true;desc:ip of node where it lives")
.addCell("node", "default:true;desc:name of node where it lives")
.endHeaders();
.addCell("node", "default:true;desc:name of node where it lives");
table.addCell("total.completion.size", "alias:tcs,totalCompletionSize;default:false;text-align:right;desc:size of completion");
table.addCell("total.fielddata.memory_size", "alias:tfm,totalFielddataMemory;default:false;text-align:right;desc:used fielddata cache");
table.addCell("total.fielddata.evictions", "alias:tfe,totalFielddataEvictions;default:false;text-align:right;desc:fielddata evictions");
table.addCell("total.filter_cache.memory_size", "alias:tfcm,totalFilterCacheMemory;default:false;text-align:right;desc:used filter cache");
table.addCell("total.filter_cache.evictions", "alias:tfce,totalFilterCacheEvictions;default:false;text-align:right;desc:filter cache evictions");
table.addCell("total.flush.total", "alias:tft,totalFlushTotal;default:false;text-align:right;desc:number of flushes");
table.addCell("total.flush.total_time", "alias:tftt,totalFlushTotalTime;default:false;text-align:right;desc:time spent in flush");
table.addCell("total.get.current", "alias:tgc,totalGetCurrent;default:false;text-align:right;desc:number of current get ops");
table.addCell("total.get.time", "alias:tgti,totalGetTime;default:false;text-align:right;desc:time spent in get");
table.addCell("total.get.total", "alias:tgto,totalGetTotal;default:false;text-align:right;desc:number of get ops");
table.addCell("total.get.exists_time", "alias:tgeti,totalGetExistsTime;default:false;text-align:right;desc:time spent in successful gets");
table.addCell("total.get.exists_total", "alias:tgeto,totalGetExistsTotal;default:false;text-align:right;desc:number of successful gets");
table.addCell("total.get.missing_time", "alias:tgmti,totalGetMissingTime;default:false;text-align:right;desc:time spent in failed gets");
table.addCell("total.get.missing_total", "alias:tgmto,totalGetMissingTotal;default:false;text-align:right;desc:number of failed gets");
table.addCell("total.id_cache.memory_size", "alias:tim,totalIdCacheMemory;default:false;text-align:right;desc:used id cache");
table.addCell("total.indexing.delete_current", "alias:tidc,totalIndexingDeleteCurrent;default:false;text-align:right;desc:number of current deletions");
table.addCell("total.indexing.delete_time", "alias:tidti,totalIndexingDeleteTime;default:false;text-align:right;desc:time spent in deletions");
table.addCell("total.indexing.delete_total", "alias:tidto,totalIndexingDeleteTotal;default:false;text-align:right;desc:number of delete ops");
table.addCell("total.indexing.index_current", "alias:tiic,totalIndexingIndexCurrent;default:false;text-align:right;desc:number of current indexing ops");
table.addCell("total.indexing.index_time", "alias:tiiti,totalIndexingIndexTime;default:false;text-align:right;desc:time spent in indexing");
table.addCell("total.indexing.index_total", "alias:tiito,totalIndexingIndexTotal;default:false;text-align:right;desc:number of indexing ops");
table.addCell("total.merges.current", "alias:tmc,totalMergesCurrent;default:false;text-align:right;desc:number of current merges");
table.addCell("total.merges.current_docs", "alias:tmcd,totalMergesCurrentDocs;default:false;text-align:right;desc:number of current merging docs");
table.addCell("total.merges.current_size", "alias:tmcs,totalMergesCurrentSize;default:false;text-align:right;desc:size of current merges");
table.addCell("total.merges.total", "alias:tmt,totalMergesTotal;default:false;text-align:right;desc:number of completed merge ops");
table.addCell("total.merges.total_docs", "alias:tmtd,totalMergesTotalDocs;default:false;text-align:right;desc:docs merged");
table.addCell("total.merges.total_size", "alias:tmts,totalMergesTotalSize;default:false;text-align:right;desc:size merged");
table.addCell("total.merges.total_time", "alias:tmtt,totalMergesTotalTime;default:false;text-align:right;desc:time spent in merges");
table.addCell("total.percolate.current", "alias:tpc,totalPercolateCurrent;default:false;text-align:right;desc:number of current percolations");
table.addCell("total.percolate.memory_size", "alias:tpm,totalPercolateMemory;default:false;text-align:right;desc:memory used by percolations");
table.addCell("total.percolate.queries", "alias:tpq,totalPercolateQueries;default:false;text-align:right;desc:number of registered percolation queries");
table.addCell("total.percolate.time", "alias:tpti,totalPercolateTime;default:false;text-align:right;desc:time spent percolating");
table.addCell("total.percolate.total", "alias:tpto,totalPercolateTotal;default:false;text-align:right;desc:total percolations");
table.addCell("total.refresh.total", "alias:trto,totalRefreshTotal;default:false;text-align:right;desc:total refreshes");
table.addCell("total.refresh.time", "alias:trti,totalRefreshTime;default:false;text-align:right;desc:time spent in refreshes");
table.addCell("total.search.fetch_current", "alias:tsfc,totalSearchFetchCurrent;default:false;text-align:right;desc:current fetch phase ops");
table.addCell("total.search.fetch_time", "alias:tsfti,totalSearchFetchTime;default:false;text-align:right;desc:time spent in fetch phase");
table.addCell("total.search.fetch_total", "alias:tsfto,totalSearchFetchTotal;default:false;text-align:right;desc:total fetch ops");
table.addCell("total.search.open_contexts", "alias:tso,totalSearchOpenContexts;default:false;text-align:right;desc:open search contexts");
table.addCell("total.search.query_current", "alias:tsqc,totalSearchQueryCurrent;default:false;text-align:right;desc:current query phase ops");
table.addCell("total.search.query_time", "alias:tsqti,totalSearchQueryTime;default:false;text-align:right;desc:time spent in query phase");
table.addCell("total.search.query_total", "alias:tsqto,totalSearchQueryTotal;default:false;text-align:right;desc:total query phase ops");
table.addCell("total.segments.count", "alias:tsc,totalSegmentsCount;default:false;text-align:right;desc:number of segments");
table.addCell("total.segments.memory", "alias:tsm,totalSegmentsMemory;default:false;text-align:right;desc:memory used by segments");
table.addCell("total.warmer.current", "alias:twc,totalWarmerCurrent;default:false;text-align:right;desc:current warmer ops");
table.addCell("total.warmer.total", "alias:twto,totalWarmerTotal;default:false;text-align:right;desc:total warmer ops");
table.addCell("total.warmer.total_time", "alias:twtt,totalWarmerTotalTime;default:false;text-align:right;desc:time spent in warmers");
table.endHeaders();
return table;
}
@ -155,6 +216,66 @@ public class RestShardsAction extends AbstractCatAction {
table.addCell(null);
}
table.addCell(shardStats == null ? null : shardStats.getCompletion().getSize());
table.addCell(shardStats == null ? null : shardStats.getFieldData().getMemorySize());
table.addCell(shardStats == null ? null : shardStats.getFieldData().getEvictions());
table.addCell(shardStats == null ? null : shardStats.getFilterCache().getMemorySize());
table.addCell(shardStats == null ? null : shardStats.getFilterCache().getEvictions());
table.addCell(shardStats == null ? null : shardStats.getFlush().getTotal());
table.addCell(shardStats == null ? null : shardStats.getFlush().getTotalTime());
table.addCell(shardStats == null ? null : shardStats.getGet().current());
table.addCell(shardStats == null ? null : shardStats.getGet().getTime());
table.addCell(shardStats == null ? null : shardStats.getGet().getCount());
table.addCell(shardStats == null ? null : shardStats.getGet().getExistsTime());
table.addCell(shardStats == null ? null : shardStats.getGet().getExistsCount());
table.addCell(shardStats == null ? null : shardStats.getGet().getMissingTime());
table.addCell(shardStats == null ? null : shardStats.getGet().getMissingCount());
table.addCell(shardStats == null ? null : shardStats.getIdCache().getMemorySize());
table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getDeleteCurrent());
table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getDeleteTime());
table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getDeleteCount());
table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getIndexCurrent());
table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getIndexTime());
table.addCell(shardStats == null ? null : shardStats.getIndexing().getTotal().getIndexCount());
table.addCell(shardStats == null ? null : shardStats.getMerge().getCurrent());
table.addCell(shardStats == null ? null : shardStats.getMerge().getCurrentNumDocs());
table.addCell(shardStats == null ? null : shardStats.getMerge().getCurrentSize());
table.addCell(shardStats == null ? null : shardStats.getMerge().getTotal());
table.addCell(shardStats == null ? null : shardStats.getMerge().getTotalNumDocs());
table.addCell(shardStats == null ? null : shardStats.getMerge().getTotalSize());
table.addCell(shardStats == null ? null : shardStats.getMerge().getTotalTime());
table.addCell(shardStats == null ? null : shardStats.getPercolate().getCurrent());
table.addCell(shardStats == null ? null : shardStats.getPercolate().getMemorySize());
table.addCell(shardStats == null ? null : shardStats.getPercolate().getNumQueries());
table.addCell(shardStats == null ? null : shardStats.getPercolate().getTime());
table.addCell(shardStats == null ? null : shardStats.getPercolate().getCount());
table.addCell(shardStats == null ? null : shardStats.getRefresh().getTotal());
table.addCell(shardStats == null ? null : shardStats.getRefresh().getTotalTime());
table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getFetchCurrent());
table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getFetchTime());
table.addCell(shardStats == null ? null : shardStats.getSearch().getTotal().getFetchCount());
table.addCell(shardStats == null ? null : shardStats.getSearch().getOpenContexts());
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.getSegments().getCount());
table.addCell(shardStats == null ? null : shardStats.getSegments().getMemory());
table.addCell(shardStats == null ? null : shardStats.getWarmer().current());
table.addCell(shardStats == null ? null : shardStats.getWarmer().total());
table.addCell(shardStats == null ? null : shardStats.getWarmer().totalTime());
table.endRow();
}