From ea0c91a165004407eaf33ed449a1b2bfcdc6fd9d Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Wed, 8 Jun 2016 08:21:38 -0400 Subject: [PATCH] Add sequence numbers to cat shards API This commit adds the max sequence number and local and global checkpoints to the cat shards API. Relates #18772 --- .../elasticsearch/rest/action/cat/RestShardsAction.java | 8 ++++++++ .../resources/rest-api-spec/test/cat.shards/10_basic.yaml | 3 +++ 2 files changed, 11 insertions(+) diff --git a/core/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java b/core/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java index 0f6bec367d5..400dc6e2d67 100644 --- a/core/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java +++ b/core/src/main/java/org/elasticsearch/rest/action/cat/RestShardsAction.java @@ -159,6 +159,10 @@ public class RestShardsAction extends AbstractCatAction { table.addCell("segments.version_map_memory", "alias:svmm,segmentsVersionMapMemory;default:false;text-align:right;desc:memory used by version map"); table.addCell("segments.fixed_bitset_memory", "alias:sfbm,fixedBitsetMemory;default:false;text-align:right;desc:memory used by fixed bit sets for nested object field types and type filters for types referred in _parent fields"); + table.addCell("seq_no.max", "alias:sqm,maxSeqNo;default:false;text-align:right;desc:max sequence number"); + table.addCell("seq_no.local_checkpoint", "alias:sql,localCheckpoint;default:false;text-align:right;desc:local checkpoint"); + table.addCell("seq_no.global_checkpoint", "alias:sqg,globalCheckpoint;default:false;text-align:right;desc:global checkpoint"); + table.addCell("warmer.current", "alias:wc,warmerCurrent;default:false;text-align:right;desc:current warmer ops"); table.addCell("warmer.total", "alias:wto,warmerTotal;default:false;text-align:right;desc:total warmer ops"); table.addCell("warmer.total_time", "alias:wtt,warmerTotalTime;default:false;text-align:right;desc:time spent in warmers"); @@ -295,6 +299,10 @@ public class RestShardsAction extends AbstractCatAction { table.addCell(commonStats == null ? null : commonStats.getSegments().getVersionMapMemory()); table.addCell(commonStats == null ? null : commonStats.getSegments().getBitsetMemory()); + table.addCell(shardStats == null || shardStats.getSeqNoStats() == null ? null : shardStats.getSeqNoStats().getMaxSeqNo()); + table.addCell(shardStats == null || shardStats.getSeqNoStats() == null ? null : shardStats.getSeqNoStats().getLocalCheckpoint()); + table.addCell(commitStats == null || shardStats.getSeqNoStats() == null ? null : shardStats.getSeqNoStats().getGlobalCheckpoint()); + table.addCell(commonStats == null ? null : commonStats.getWarmer().current()); table.addCell(commonStats == null ? null : commonStats.getWarmer().total()); table.addCell(commonStats == null ? null : commonStats.getWarmer().totalTime()); diff --git a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.shards/10_basic.yaml b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.shards/10_basic.yaml index 28da3be4511..79b2a623fef 100755 --- a/rest-api-spec/src/main/resources/rest-api-spec/test/cat.shards/10_basic.yaml +++ b/rest-api-spec/src/main/resources/rest-api-spec/test/cat.shards/10_basic.yaml @@ -65,6 +65,9 @@ segments.index_writer_memory .+ \n segments.version_map_memory .+ \n segments.fixed_bitset_memory .+ \n + seq_no.max .+ \n + seq_no.local_checkpoint .+ \n + seq_no.global_checkpoint .+ \n warmer.current .+ \n warmer.total .+ \n warmer.total_time .+ \n