Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
---
"Test stats":
- do:
indices.create:
index: foo
body:
settings:
index:
soft_deletes:
enabled: true
mappings:
doc:
properties:
field:
type: keyword

- do:
ccr.follow:
index: bar
body:
leader_index: foo
- is_true: follow_index_created
- is_true: follow_index_shards_acked
- is_true: index_following_started

# we can not reliably wait for replication to occur so we test the endpoint without indexing any documents
- do:
ccr.stats:
index: bar
- match: { indices.0.index: "bar" }
- match: { indices.0.shards.0.leader_index: "foo" }
- match: { indices.0.shards.0.follower_index: "bar" }
- match: { indices.0.shards.0.shard_id: 0 }
- gte: { indices.0.shards.0.leader_global_checkpoint: -1 }
- gte: { indices.0.shards.0.leader_max_seq_no: -1 }
- gte: { indices.0.shards.0.follower_global_checkpoint: -1 }
- gte: { indices.0.shards.0.follower_max_seq_no: -1 }
- gte: { indices.0.shards.0.last_requested_seq_no: -1 }
- gte: { indices.0.shards.0.number_of_concurrent_reads: 0 }
- match: { indices.0.shards.0.number_of_concurrent_writes: 0 }
- match: { indices.0.shards.0.number_of_queued_writes: 0 }
- gte: { indices.0.shards.0.mapping_version: 0 }
- gte: { indices.0.shards.0.total_fetch_time_millis: 0 }
- gte: { indices.0.shards.0.number_of_successful_fetches: 0 }
- gte: { indices.0.shards.0.number_of_failed_fetches: 0 }
- match: { indices.0.shards.0.operations_received: 0 }
- match: { indices.0.shards.0.total_transferred_bytes: 0 }
- match: { indices.0.shards.0.total_index_time_millis: 0 }
- match: { indices.0.shards.0.number_of_successful_bulk_operations: 0 }
- match: { indices.0.shards.0.number_of_failed_bulk_operations: 0 }
- match: { indices.0.shards.0.number_of_operations_indexed: 0 }
- length: { indices.0.shards.0.fetch_exceptions: 0 }
- gte: { indices.0.shards.0.time_since_last_fetch_millis: -1 }

- do:
ccr.pause_follow:
index: bar
- is_true: acknowledged

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,24 @@ public XContentBuilder toXContent(final XContentBuilder builder, final Params pa
}
builder.startObject();
{
for (final Map.Entry<String, Map<Integer, StatsResponse>> index : taskResponsesByIndex.entrySet()) {
builder.startArray(index.getKey());
{
for (final Map.Entry<Integer, StatsResponse> shard : index.getValue().entrySet()) {
shard.getValue().status().toXContent(builder, params);
builder.startArray("indices");
{
for (final Map.Entry<String, Map<Integer, StatsResponse>> index : taskResponsesByIndex.entrySet()) {
builder.startObject();
{
builder.field("index", index.getKey());
builder.startArray("shards");
{
for (final Map.Entry<Integer, StatsResponse> shard : index.getValue().entrySet()) {
shard.getValue().status().toXContent(builder, params);
}
}
builder.endArray();
}
builder.endObject();
}
builder.endArray();
}
builder.endArray();
}
builder.endObject();
return builder;
Expand Down