Skip to content
Open
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions docs/command_line_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,11 @@ All track parameters are recorded for each metrics record in the metrics store.

Note that the default values are not recorded or shown (Rally does not know about them).

``ignore-unused-track-params``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

By default, Rally mandates that all provided track-parameters be used by the target track. Adding this flag suppresses that behavior; instead, Rally will write a warning to the log-file, then proceed as normal.

``challenge``
~~~~~~~~~~~~~

Expand Down
19 changes: 19 additions & 0 deletions esrally/rally.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,12 @@ def add_track_source(subparser):
help="Define a comma-separated list of key:value pairs that are injected verbatim to the track as variables.",
default="",
)
info_parser.add_argument(
"--ignore-unused-track-params",
help="Only warn (instead of failing) when track parameters are given that are not used by the track.",
action="store_true",
default=False,
)
info_parser.add_argument(
"--challenge",
help=f"Define the challenge to use. List possible challenges for tracks with `{PROGRAM_NAME} list tracks`.",
Expand All @@ -254,6 +260,12 @@ def add_track_source(subparser):
help="Define a comma-separated list of key:value pairs that are injected verbatim to the track as variables.",
default="",
)
render_track_parser.add_argument(
"--ignore-unused-track-params",
help="Only warn (instead of failing) when track parameters are given that are not used by the track.",
action="store_true",
default=False,
)
render_track_parser.add_argument(
"--build-flavor",
help="Define the build flavor to render the track for.",
Expand Down Expand Up @@ -685,6 +697,12 @@ def add_track_source(subparser):
help="Define a comma-separated list of key:value pairs that are injected verbatim to the track as variables.",
default="",
)
race_parser.add_argument(
"--ignore-unused-track-params",
help="Only warn (instead of failing) when track parameters are given that are not used by the track.",
action="store_true",
default=False,
)
race_parser.add_argument(
"--challenge",
help=f"Define the challenge to use. List possible challenges for tracks with `{PROGRAM_NAME} list tracks`.",
Expand Down Expand Up @@ -1115,6 +1133,7 @@ def configure_track_params(arg_parser, args, cfg: types.Config, command_requires

if command_requires_track_details:
cfg.add(config.Scope.applicationOverride, "track", "params", opts.to_dict(args.track_params))
cfg.add(config.Scope.applicationOverride, "track", "params.ignore_unused", args.ignore_unused_track_params)
cfg.add(config.Scope.applicationOverride, "track", "challenge.name", args.challenge)
cfg.add(config.Scope.applicationOverride, "track", "include.tasks", opts.csv_to_list(args.include_tasks))
cfg.add(config.Scope.applicationOverride, "track", "exclude.tasks", opts.csv_to_list(args.exclude_tasks))
Expand Down
12 changes: 8 additions & 4 deletions esrally/track/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,6 +1132,7 @@ def __init__(self, cfg: types.Config):
self.build_flavor = cfg.opts("mechanic", "distribution.flavor", default_value="default", mandatory=False)
self.serverless_operator = cfg.opts("driver", "serverless.operator", default_value=False, mandatory=False)
self.track_params = cfg.opts("track", "params", mandatory=False)
self.ignore_unused_params = cfg.opts("track", "params.ignore_unused", mandatory=False)
self.complete_track_params = CompleteTrackParams(user_specified_track_params=self.track_params)
self.read_track = TrackSpecificationReader(
track_params=self.track_params,
Expand Down Expand Up @@ -1256,10 +1257,13 @@ def read(self, track_name, track_spec_file, mapping_dir):
)
)

LOG.critical(err_msg)
# also dump the message on the console
console.println(err_msg)
raise exceptions.TrackConfigError(f"Unused track parameters {sorted(unused_user_defined_track_params)}.")
if self.ignore_unused_params:
LOG.warning(err_msg)
console.warn(err_msg)
else:
LOG.critical(err_msg)
console.error(err_msg)
raise exceptions.TrackConfigError(f"Unused track parameters {sorted(unused_user_defined_track_params)}.")
return current_track


Expand Down
1 change: 1 addition & 0 deletions esrally/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"output.path",
"output.processingtime",
"params",
"params.ignore_unused",
"passenv",
"pipeline",
"plugin.community-plugin.src.dir",
Expand Down
Loading