Add post-init for load params
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
449c18bb1a
commit
e14896400f
1 changed files with 12 additions and 2 deletions
|
@ -271,6 +271,16 @@ class LoadParams:
|
||||||
|
|
||||||
return env_vars
|
return env_vars
|
||||||
|
|
||||||
|
def __post_init__(self):
|
||||||
|
default_scenario_map = {
|
||||||
|
LoadType.gRPC: LoadScenario.gRPC,
|
||||||
|
LoadType.HTTP: LoadScenario.HTTP,
|
||||||
|
LoadType.S3: LoadScenario.S3,
|
||||||
|
}
|
||||||
|
|
||||||
|
if self.scenario is None:
|
||||||
|
self.scenario = default_scenario_map[self.load_type]
|
||||||
|
|
||||||
def get_preset_arguments(self):
|
def get_preset_arguments(self):
|
||||||
command_args = [
|
command_args = [
|
||||||
self._get_preset_argument(meta_field)
|
self._get_preset_argument(meta_field)
|
||||||
|
@ -324,7 +334,7 @@ class LoadParams:
|
||||||
# TODO: migrate load_params defaults to testlib
|
# TODO: migrate load_params defaults to testlib
|
||||||
if self.object_size is not None:
|
if self.object_size is not None:
|
||||||
size, unit = calc_unit(self.object_size, 1)
|
size, unit = calc_unit(self.object_size, 1)
|
||||||
static_params = [f"{load_type_str} ({size:.4g} {unit})"]
|
static_params = [f"{load_type_str} {size:.4g} {unit}"]
|
||||||
else:
|
else:
|
||||||
static_params = [f"{load_type_str}"]
|
static_params = [f"{load_type_str}"]
|
||||||
|
|
||||||
|
@ -335,7 +345,7 @@ class LoadParams:
|
||||||
]
|
]
|
||||||
params = ", ".join(static_params + dynamic_params)
|
params = ", ".join(static_params + dynamic_params)
|
||||||
|
|
||||||
return f"load: {params}"
|
return params
|
||||||
|
|
||||||
def __repr__(self) -> str:
|
def __repr__(self) -> str:
|
||||||
return self.__str__()
|
return self.__str__()
|
||||||
|
|
Loading…
Reference in a new issue