-
Notifications
You must be signed in to change notification settings - Fork 507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add common operations section to User Guide. #7974
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
181 changes: 181 additions & 0 deletions
181
_benchmark/user-guide/understanding-workloads/common-operations.md
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,181 @@ | ||
--- | ||
layout: default | ||
title: Common operations | ||
nav_order: 16 | ||
grand_parent: User guide | ||
parent: Understanding workloads | ||
--- | ||
|
||
# Common operations | ||
|
||
[Test procedures]({{site.url}}{{site.baseurl}}/benchmark/user-guide/understanding-workloads/anatomy-of-a-workload#_operations-and-_test-procedures) use a variety of operations, found inside the `operations` directory of a workload. This page details the most common operations found inside Benchmark workloads. | ||
Naarcha-AWS marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
- [Common operations](#common-operations) | ||
- [bulk](#bulk) | ||
- [create-index](#create-index) | ||
- [delete-index](#delete-index) | ||
- [cluster-health](#cluster-health) | ||
- [refresh](#refresh) | ||
- [search](#search) | ||
|
||
<!-- vale off --> | ||
## bulk | ||
<!-- vale on --> | ||
|
||
The `bulk` operation type allows you to run [bulk](/api-reference/document-apis/bulk/) requests as a task. | ||
|
||
The following example shows a `bulk` operation type with a `bulk-size` of `5000` documents: | ||
|
||
```yml | ||
{ | ||
"name": "index-append", | ||
"operation-type": "bulk", | ||
"bulk-size": 5000 | ||
} | ||
``` | ||
|
||
|
||
<!-- vale off --> | ||
## create-index | ||
<!-- vale on --> | ||
|
||
The `create-index` operation runs the [Create Index API](/api-reference/index-apis/create-index/). It supports the following two modes of index creation: | ||
|
||
- Creating all indexes specified in the workloads `indices` section | ||
- Creating one specific index defined within the operation itself | ||
|
||
The following example creates all indexes defined in the `indices` section of the workload. It uses all of the index settings defined in the workload but overrides the number of shards: | ||
|
||
```yml | ||
{ | ||
"name": "create-all-indices", | ||
"operation-type": "create-index", | ||
"settings": { | ||
"index.number_of_shards": 1 | ||
}, | ||
"request-params": { | ||
"wait_for_active_shards": "true" | ||
} | ||
} | ||
``` | ||
|
||
The following example creates a new index with all index settings specified in the operation body: | ||
|
||
```yml | ||
{ | ||
"name": "create-an-index", | ||
"operation-type": "create-index", | ||
"index": "people", | ||
"body": { | ||
"settings": { | ||
"index.number_of_shards": 0 | ||
}, | ||
"mappings": { | ||
"docs": { | ||
"properties": { | ||
"name": { | ||
"type": "text" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
``` | ||
|
||
|
||
|
||
<!-- vale off --> | ||
## delete-index | ||
<!-- vale on --> | ||
|
||
The `delete-index` operation runs the [Delete Index API](api-reference/index-apis/delete-index/). Like with the [`create-index`](#create-index) operation, you can delete all indexes found in the `indices` section of the workload or delete one or more indexes based on the string passed in the `index` setting. | ||
|
||
The following example deletes all indexes found in the `indices` section of the workload: | ||
|
||
```yml | ||
{ | ||
"name": "delete-all-indices", | ||
"operation-type": "delete-index" | ||
} | ||
``` | ||
|
||
The following example deletes all `logs_*` indexes: | ||
|
||
```yml | ||
{ | ||
"name": "delete-logs", | ||
"operation-type": "delete-index", | ||
"index": "logs-*", | ||
"only-if-exists": false, | ||
"request-params": { | ||
"expand_wildcards": "all", | ||
"allow_no_indices": "true", | ||
"ignore_unavailable": "true" | ||
} | ||
} | ||
``` | ||
|
||
<!-- vale off --> | ||
## cluster-health | ||
<!-- vale on --> | ||
|
||
The `cluster-health` operation runs the [Cluster Health API](api-reference/cluster-api/cluster-health/), which checks the cluster health status and returns the expected status according to the parameters set for `request-params`. If an unexpected cluster health status is returned, the operation reports a failure. You can use the `--on-error` option in the OpenSearch Benchmark `execute-test` command to control how OpenSearch Benchmark behaves when the health check fails. | ||
|
||
The following example creates a `cluster-health` operation that checks for a `green` health status on any `log-*` indexes: | ||
|
||
```yml | ||
{ | ||
"name": "check-cluster-green", | ||
"operation-type": "cluster-health", | ||
"index": "logs-*", | ||
"request-params": { | ||
"wait_for_status": "green", | ||
"wait_for_no_relocating_shards": "true" | ||
}, | ||
"retry-until-success": true | ||
} | ||
|
||
``` | ||
|
||
<!-- vale off --> | ||
## refresh | ||
<!-- vale on --> | ||
|
||
The `refresh` operation runs the Refresh API. The `operation` returns no metadata. | ||
|
||
|
||
The following example refreshes all `logs-*` indexes: | ||
|
||
```yml | ||
{ | ||
"name": "refresh", | ||
"operation-type": "refresh", | ||
"index": "logs-*" | ||
} | ||
``` | ||
|
||
|
||
<!-- vale off --> | ||
## search | ||
<!-- vale on --> | ||
|
||
The `search` operation runs the [Search API](/api-reference/search/), which you can use to run queries in OpenSearch Benchmark indexes. | ||
|
||
The following example runs a `match_all` query inside the `search` operation: | ||
|
||
```yml | ||
{ | ||
"name": "default", | ||
"operation-type": "search", | ||
"body": { | ||
"query": { | ||
"match_all": {} | ||
} | ||
}, | ||
"request-params": { | ||
"_source_include": "some_field", | ||
"analyze_wildcard": "false" | ||
} | ||
} | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should "OpenSearch" precede "Benchmark to be consistent naming convention throughout this doc (for example, line 123?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.