Skip to content

Commit e048c28

Browse files
committed
Allow time within a test to override global time setting in YAML and allow multiple mixed read/write workloads within a YAML
This commit only changes the functionality of workloads in CBT. This commit adds two pieces of functionality: 1) Workloads with randrw only lets you specify 1 mixed workload within a YAML as the same directory name was used for subsequent randrw workloads, thus overwriting all the previous resuilts in the archive directory with the later tests. This commit adds the readwrite ratio into the directory name if the mode is randrw. The directory name for 100% read and 100% write tests are unaffected. 2) Prior to this commit, all workloads inherited "time" from the outer/global part of the YAML. This meant you couldn't set different time for each test within the "workloads". Typically for preconditioning you'd want to precondition for a set amount of time ( 600 seconds - 10minutes), then set the workload time to be 120 seconds (2 minutes). If you do not set a "time" within the workload, the time for that specific test will be inherited from the global "time" within the YAML. Signed-off-by: lee-j-sanders <ljsanders@uk.ibm.com>
1 parent dc1a795 commit e048c28

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

benchmark/librbdfio.py

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ def backup_global_fio_options(self):
9999
Backup/copy the FIO global options into a dictionary
100100
"""
101101
self.global_fio_options['time_based'] = self.time_based
102+
self.global_fio_options['time'] = self.time
102103
self.global_fio_options['ramp'] = self.ramp
103104
self.global_fio_options['iodepth'] = self.iodepth
104105
self.global_fio_options['numjobs'] = self.numjobs
@@ -124,7 +125,7 @@ def restore_global_fio_options(self):
124125
self.log_avg_msec = self.global_fio_options['log_avg_msec']
125126
self.op_size = self.global_fio_options['op_size']
126127
self.time_based = self.global_fio_options['time_based']
127-
128+
self.time = self.global_fio_options['time']
128129

129130
def exists(self):
130131
"""
@@ -184,14 +185,28 @@ def run_workloads(self):
184185
self._ioddepth_per_volume = self._calculate_iodepth_per_volume(
185186
int(self.volumes_per_client), int(iod)
186187
)
188+
189+
self.time = test['time']
187190
self.mode = test['mode']
188191
if 'op_size' in test:
189192
self.op_size = test['op_size']
190-
self.mode = test['mode']
191193
self.numjobs = job
192194
self.iodepth = iod
193-
self.run_dir = ( f'{self.base_run_dir}/{self.mode}_{int(self.op_size)}/'
194-
f'iodepth-{int(self.iodepth):03d}/numjobs-{int(self.numjobs):03d}' )
195+
196+
# Needed to allow for different mixed ratio results with the same block size, we
197+
# store the ratio within the directory name. Otherwise workloads would only support
198+
# 1 mixed workload for a given block size. For 100% read, 100% write don't need to
199+
# store the read/write ratio.
200+
201+
if self.mode == 'randrw':
202+
self.rwmixread = test['rwmixread']
203+
self.rwmixwrite = 100 - self.rwmixread
204+
self.run_dir = ( f'{self.base_run_dir}/{self.mode}{self.rwmixread}{self.rwmixwrite}_{int(self.op_size)}/'
205+
f'iodepth-{int(self.iodepth):03d}/numjobs-{int(self.numjobs):03d}' )
206+
else:
207+
self.run_dir = ( f'{self.base_run_dir}/{self.mode}_{int(self.op_size)}/'
208+
f'iodepth-{int(self.iodepth):03d}/numjobs-{int(self.numjobs):03d}' )
209+
195210
common.make_remote_dir(self.run_dir)
196211

197212
number_of_volumes: int = int(self.volumes_per_client)

0 commit comments

Comments
 (0)