forked from TrueCloudLab/frostfs-testlib
[#91] Failover enhancements
Signed-off-by: Andrey Berezin <a.berezin@yadro.com>
This commit is contained in:
parent
9feb8135e3
commit
98ccd4c382
16 changed files with 200 additions and 56 deletions
|
@ -1,3 +1,4 @@
|
|||
import math
|
||||
import os
|
||||
from dataclasses import dataclass, field, fields, is_dataclass
|
||||
from enum import Enum
|
||||
|
@ -133,6 +134,12 @@ class Preset:
|
|||
# S3 region (AKA placement policy for S3 buckets)
|
||||
s3_location: Optional[str] = metadata_field(s3_preset_scenarios, "location", None, False)
|
||||
|
||||
# Delay between containers creation and object upload for preset
|
||||
object_upload_delay: Optional[int] = metadata_field(all_load_scenarios, "sleep", None, False)
|
||||
|
||||
# Flag to control preset erorrs
|
||||
ignore_errors: Optional[bool] = metadata_field(all_load_scenarios, "ignore-errors", None, False)
|
||||
|
||||
|
||||
@dataclass
|
||||
class LoadParams:
|
||||
|
@ -194,6 +201,12 @@ class LoadParams:
|
|||
# https://k6.io/docs/using-k6/k6-options/reference/#setup-timeout
|
||||
setup_timeout: Optional[str] = metadata_field(all_scenarios, None, "K6_SETUP_TIMEOUT", False)
|
||||
|
||||
# Delay for read operations in case if we read from registry
|
||||
read_age: Optional[int] = metadata_field(all_load_scenarios, None, "READ_AGE", None, False)
|
||||
|
||||
# Initialization time for each VU for k6 load
|
||||
vu_init_time: Optional[float] = None
|
||||
|
||||
# ------- CONSTANT VUS SCENARIO PARAMS -------
|
||||
# Amount of Writers VU.
|
||||
writers: Optional[int] = metadata_field(constant_vus_scenarios, None, "WRITERS", True, True)
|
||||
|
@ -306,6 +319,16 @@ class LoadParams:
|
|||
|
||||
return command_args
|
||||
|
||||
def get_init_time(self) -> int:
|
||||
return math.ceil(self._get_total_vus() * self.vu_init_time)
|
||||
|
||||
def _get_total_vus(self) -> int:
|
||||
vu_fields = ["writers", "preallocated_writers"]
|
||||
data_fields = [
|
||||
getattr(self, field.name) or 0 for field in fields(self) if field.name in vu_fields
|
||||
]
|
||||
return sum(data_fields)
|
||||
|
||||
def _get_applicable_fields(self):
|
||||
applicable_fields = [
|
||||
meta_field
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue