Skip to content

Commit

Permalink
Set cluster-settings via API
Browse files Browse the repository at this point in the history
With this commit we avoid the soon to be deprecated track property
`cluster-settings` in the `pmc` track and instead implement a fallback
using the update cluster settings API. Newer versions of Rally will
expose this API via a runner but for older versions we need to implement
it in the track.

Relates #93
  • Loading branch information
danielmitterdorfer authored Dec 4, 2019
1 parent 93c7da7 commit fb4b596
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
13 changes: 10 additions & 3 deletions pmc/challenges/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,17 @@
"name": "append-no-conflicts",
"description": "Indexes the whole document corpus using Elasticsearch default settings. We only adjust the number of replicas as we benchmark a single node cluster and Rally will only start the benchmark if the cluster turns green. Document ids are unique so all index operations are append only. After that a couple of queries are run.",
"default": true,
"cluster-settings": {
"search.default_search_timeout": "{{default_search_timeout | default(-1)}}"
},
"schedule": [
{
"operation": {
"operation-type": "put-settings",
"body": {
"transient": {
"search.default_search_timeout": "{{default_search_timeout | default(-1)}}"
}
}
}
},
{
"operation": "delete-index"
},
Expand Down
10 changes: 10 additions & 0 deletions pmc/track.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
def put_settings(es, params):
es.cluster.put_settings(body=params["body"])


def register(registry):
# register a fallback for older Rally versions
try:
from esrally.driver.runner import PutSettings
except ImportError:
registry.register_runner("put-settings", put_settings)

0 comments on commit fb4b596

Please sign in to comment.