Skip to content

Commit

Permalink
Test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DaveCTurner committed Jun 14, 2024
1 parent a228b0b commit a3ed524
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions docs/reference/cluster/stats.asciidoc
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ space of deleted Lucene documents when a segment is merged.
`total_size_in_bytes`::
(integer)
Total size in bytes across all primary shards assigned to selected nodes.

`total_size`::
(string)
Total size across all primary shards assigned to selected nodes, as a human-readable string.
=====
`store`::
Expand Down Expand Up @@ -1600,6 +1604,7 @@ The API returns the following response:
"count": 10,
"deleted": 0,
"total_size_in_bytes": 8833
"total_size": "8.6kb"
},
"store": {
"size": "16.2kb",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
---
"cluster stats with human flag returns docs as human readable size":
- requires:
test_runner_features: [capabilities]
capabilities:
- method: GET
path: /_cluster/stats
capabilities:
- "human-readable-total-docs-size"
test_runner_feature: [capabilities]
reason: Capability required to run test
reason: "Capability required to run test"

- do:
index:
Expand All @@ -53,8 +53,8 @@
cluster.stats:
human: true

- is_true: indices.docs.total_size_in_bytes
- is_true: indices.docs.total_size
- exists: indices.docs.total_size_in_bytes
- exists: indices.docs.total_size

---
"get cluster stats returns cluster_uuid at the top level":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public void testToXContent() throws IOException {

private CommonStats mockCommonStats() {
final CommonStats commonStats = new CommonStats(CommonStatsFlags.ALL);
commonStats.getDocs().add(new DocsStats(1L, 0L, randomNonNegativeLong()));
commonStats.getDocs().add(new DocsStats(1L, 0L, randomNonNegativeLong() >> 8)); // >> 8 to avoid overflow - we add these things up
commonStats.getStore().add(new StoreStats(2L, 0L, 0L));

final IndexingStats.Stats indexingStats = new IndexingStats.Stats(3L, 4L, 0L, 0L, 0L, 0L, 0L, 0L, true, 5L, 0, 0);
Expand Down

0 comments on commit a3ed524

Please sign in to comment.