Skip to content

Commit

Permalink
Improve indices.stats schemas (#491)
Browse files Browse the repository at this point in the history
* Improve indices.stats schemas

Signed-off-by: Thomas Farr <[email protected]>

* Add changelog

Signed-off-by: Thomas Farr <[email protected]>

* Remove unused schemas

Signed-off-by: Thomas Farr <[email protected]>

---------

Signed-off-by: Thomas Farr <[email protected]>
  • Loading branch information
Xtansia committed Aug 12, 2024
1 parent 644a1a5 commit 597ed8d
Show file tree
Hide file tree
Showing 5 changed files with 118 additions and 235 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
- Fixed `_source` accepting an array of fields in `/_search` ([#430](https://github.com/opensearch-project/opensearch-api-specification/pull/430))
- Fixed `_update_by_query` with a simple term ([#451](https://github.com/opensearch-project/opensearch-api-specification/pull/451))
- Fixed `Duration` to allow for non-integers ([#479](https://github.com/opensearch-project/opensearch-api-specification/pull/479))
- Fixed accuracy of the index stats schemas ([#491](https://github.com/opensearch-project/opensearch-api-specification/pull/491))

### Security

Expand Down
8 changes: 4 additions & 4 deletions spec/namespaces/indices.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2686,14 +2686,14 @@ components:
schema:
type: object
properties:
_shards:
$ref: '../schemas/_common.yaml#/components/schemas/ShardStatistics'
_all:
$ref: '../schemas/indices.stats.yaml#/components/schemas/AllIndicesStats'
indices:
type: object
additionalProperties:
$ref: '../schemas/indices.stats.yaml#/components/schemas/IndicesStats'
_shards:
$ref: '../schemas/_common.yaml#/components/schemas/ShardStatistics'
_all:
$ref: '../schemas/indices.stats.yaml#/components/schemas/IndicesStats'
required:
- _all
- _shards
Expand Down
147 changes: 56 additions & 91 deletions spec/schemas/_common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1250,13 +1250,6 @@ components:
reserved_in_bytes:
description: A prediction, in bytes, of how much larger the shard stores will eventually grow due to ongoing peer recoveries, restoring snapshots, and similar activities.
type: number
total_data_set_size:
$ref: '#/components/schemas/ByteSize'
total_data_set_size_in_bytes:
description: |-
Total data set size, in bytes, of all shards assigned to selected nodes.
This includes the size of shards not stored fully on the nodes, such as the cache for partially mounted indices.
type: number
required:
- reserved_in_bytes
- size_in_bytes
Expand Down Expand Up @@ -1503,25 +1496,25 @@ components:
GetStats:
type: object
properties:
current:
total:
type: number
exists_time:
time:
$ref: '#/components/schemas/Duration'
exists_time_in_millis:
time_in_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
exists_total:
type: number
missing_time:
exists_time:
$ref: '#/components/schemas/Duration'
missing_time_in_millis:
exists_time_in_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
missing_total:
type: number
time:
missing_time:
$ref: '#/components/schemas/Duration'
time_in_millis:
missing_time_in_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
total:
current:
type: number
required:
- current
Expand All @@ -1534,40 +1527,39 @@ components:
IndexingStats:
type: object
properties:
index_total:
type: number
index_time:
$ref: '#/components/schemas/Duration'
index_time_in_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
index_current:
type: number
delete_current:
index_failed:
type: number
delete_total:
type: number
delete_time:
$ref: '#/components/schemas/Duration'
delete_time_in_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
delete_total:
delete_current:
type: number
doc_status:
$ref: '#/components/schemas/DocStatus'
is_throttled:
type: boolean
noop_update_total:
type: number
is_throttled:
type: boolean
throttle_time:
$ref: '#/components/schemas/Duration'
throttle_time_in_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
index_time:
$ref: '#/components/schemas/Duration'
index_time_in_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
index_total:
type: number
index_failed:
type: number
doc_status:
$ref: '#/components/schemas/DocStatus'
types:
x-version-removed: '2.0'
type: object
additionalProperties:
$ref: '#/components/schemas/IndexingStats'
write_load:
type: number
required:
- delete_current
- delete_time_in_millis
Expand Down Expand Up @@ -1684,6 +1676,21 @@ components:
SearchStats:
type: object
properties:
open_contexts:
description: The number of open search contexts.
type: number
query_current:
description: The number of shard query operations that are currently running.
type: number
query_time:
description: The total amount of time for all shard query operations.
$ref: '#/components/schemas/Duration'
query_time_in_millis:
description: The total amount of time for all shard query operations, in milliseconds.
$ref: '#/components/schemas/DurationValueUnitMillis'
query_total:
description: The total number of shard query operations.
type: number
concurrent_query_total:
description: The total number of query operations that use concurrent segment search.
type: number
Expand All @@ -1710,39 +1717,6 @@ components:
fetch_total:
description: The total number of shard fetch operations.
type: number
open_contexts:
description: The number of open search contexts.
type: number
point_in_time_total:
description: The total number of shard Point in Time (PIT) contexts that have been created (completed and active) since the node last restarted.
type: number
point_in_time_time:
$ref: '#/components/schemas/Duration'
point_in_time_time_in_millis:
description: The amount of time that shard PIT contexts have been held open since the node last restarted, in milliseconds.
$ref: '#/components/schemas/DurationValueUnitMillis'
point_in_time_current:
description: The number of shard PIT contexts currently open.
type: number
query_current:
description: The number of shard query operations that are currently running.
type: number
query_time:
description: The total amount of time for all shard query operations.
$ref: '#/components/schemas/Duration'
query_time_in_millis:
description: The total amount of time for all shard query operations, in milliseconds.
$ref: '#/components/schemas/DurationValueUnitMillis'
query_total:
description: The total number of shard query operations.
type: number
request:
type: object
description: Statistics about coordinator search operations for the node.
additionalProperties:
$ref: '#/components/schemas/RequestStats'
search_idle_reactivate_count_total:
type: number
scroll_current:
description: The number of shard scroll operations that are currently running.
type: number
Expand All @@ -1755,6 +1729,17 @@ components:
scroll_total:
description: The total number of shard scroll operations.
type: number
point_in_time_total:
description: The total number of shard Point in Time (PIT) contexts that have been created (completed and active) since the node last restarted.
type: number
point_in_time_time:
$ref: '#/components/schemas/Duration'
point_in_time_time_in_millis:
description: The amount of time that shard PIT contexts have been held open since the node last restarted, in milliseconds.
$ref: '#/components/schemas/DurationValueUnitMillis'
point_in_time_current:
description: The number of shard PIT contexts currently open.
type: number
suggest_current:
description: The number of shard suggest operations that are currently running.
type: number
Expand All @@ -1767,6 +1752,13 @@ components:
suggest_total:
description: The total number of shard suggest operations.
type: number
search_idle_reactivate_count_total:
type: number
request:
type: object
description: Statistics about coordinator search operations for the node.
additionalProperties:
$ref: '#/components/schemas/RequestStats'
groups:
type: object
additionalProperties:
Expand Down Expand Up @@ -1833,33 +1825,6 @@ components:
- current
- total
- total_time_in_millis
BulkStats:
type: object
properties:
total_operations:
type: number
total_time:
$ref: '#/components/schemas/Duration'
total_time_in_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
total_size:
$ref: '#/components/schemas/ByteSize'
total_size_in_bytes:
type: number
avg_time:
$ref: '#/components/schemas/Duration'
avg_time_in_millis:
$ref: '#/components/schemas/DurationValueUnitMillis'
avg_size:
$ref: '#/components/schemas/ByteSize'
avg_size_in_bytes:
type: number
required:
- avg_size_in_bytes
- avg_time_in_millis
- total_operations
- total_size_in_bytes
- total_time_in_millis
GeoShapeRelation:
type: string
enum:
Expand Down
Loading

0 comments on commit 597ed8d

Please sign in to comment.