forked from opensearch-project/OpenSearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Provide repository-level stats for searchable snapshots (#55051)
Provides basic repository-level stats that will allow us to get some insight into how many requests are actually being made by the underlying SDK. Currently only tracks GET and LIST calls for S3 repositories. Most of the code is unfortunately boiler plate to add a new endpoint that will help us better understand some of the low-level dynamics of searchable snapshots.
- Loading branch information
Showing
24 changed files
with
837 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
docs/reference/searchable-snapshots/apis/mount-snapshot.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
docs/reference/searchable-snapshots/apis/repository-stats.asciidoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
[role="xpack"] | ||
[testenv="platinum"] | ||
[[searchable-snapshots-repository-stats]] | ||
=== Searchable snapshot repository statistics API | ||
++++ | ||
<titleabbrev>Searchable snapshot repository statistics</titleabbrev> | ||
++++ | ||
|
||
experimental[] | ||
|
||
Retrieve usage statistics about a snapshot repository. | ||
|
||
[[searchable-snapshots-repository-stats-request]] | ||
==== {api-request-title} | ||
|
||
`GET /_snapshot/<repository>/_stats` | ||
|
||
[[searchable-snapshots-repository-stats-prereqs]] | ||
==== {api-prereq-title} | ||
|
||
If the {es} {security-features} are enabled, you must have the | ||
`manage` cluster privilege and the `manage` index privilege | ||
for any included indices to use this API. | ||
For more information, see <<security-privileges>>. | ||
|
||
[[searchable-snapshots-repository-stats-desc]] | ||
==== {api-description-title} | ||
|
||
|
||
[[searchable-snapshots-repository-stats-path-params]] | ||
==== {api-path-parms-title} | ||
|
||
`<repository>`:: | ||
(Required, string) | ||
The repository for which to retrieve stats. | ||
|
||
|
||
[[searchable-snapshots-repository-stats-example]] | ||
==== {api-examples-title} | ||
//// | ||
[source,console] | ||
----------------------------------- | ||
PUT /docs | ||
{ | ||
"settings" : { | ||
"index.number_of_shards" : 1, | ||
"index.number_of_replicas" : 0 | ||
} | ||
} | ||
PUT /_snapshot/my_repository/my_snapshot?wait_for_completion=true | ||
{ | ||
"include_global_state": false, | ||
"indices": "docs" | ||
} | ||
DELETE /docs | ||
POST /_snapshot/my_repository/my_snapshot/_mount?wait_for_completion=true | ||
{ | ||
"index": "docs" | ||
} | ||
----------------------------------- | ||
// TEST[setup:setup-repository] | ||
//// | ||
|
||
Retrieves the statistics of the repository `my_repository`: | ||
|
||
[source,console] | ||
-------------------------------------------------- | ||
GET /_snapshot/my_repository/_stats | ||
-------------------------------------------------- | ||
// TEST[continued] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.