Skip to content
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

Support request-params for bulk operation #501

Merged
merged 1 commit into from
Apr 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion osbenchmark/worker_coordinator/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -475,6 +475,7 @@ async def __call__(self, opensearch, params):
The following keys are optional:

* ``pipeline``: If present, runs the the specified ingest pipeline for this bulk.
* ``request-params``: If present, they will be passed as parameters of bulk.
* ``detailed-results``: If ``True``, the runner will analyze the response and add detailed meta-data. Defaults to ``False``. Note
that this has a very significant impact on performance and will very
likely cause a bottleneck in the benchmark worker_coordinator so please
Expand All @@ -486,12 +487,17 @@ async def __call__(self, opensearch, params):
``None`` and potentially falls back to the global timeout setting.
"""
detailed_results = params.get("detailed-results", False)
api_kwargs = self._default_kw_params(params)

bulk_params = {}
if "pipeline" in params:
bulk_params["pipeline"] = params["pipeline"]

if "request-params" in params:
bulk_params.update(params["request-params"])
params.pop( "request-params" )

api_kwargs = self._default_kw_params(params)

with_action_metadata = mandatory(params, "action-metadata-present", self)
bulk_size = mandatory(params, "bulk-size", self)
unit = mandatory(params, "unit", self)
Expand Down
Loading