Skip to content

Commit 9198912

Browse files
p3rf Teamcopybara-github
authored andcommitted
Update stress_ng_benchmark with vm stressors
PiperOrigin-RevId: 833999087
1 parent 63b4044 commit 9198912

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

perfkitbenchmarker/linux_benchmarks/stress_ng_benchmark.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,16 @@
380380
0,
381381
'memrate worker write rate in MiB/s. Only applies to "memrate" stressor.'
382382
)
383+
flags.DEFINE_integer(
384+
'stress_ng_vm_count',
385+
4,
386+
'Number of VMs to run the "vm" stressor on.'
387+
)
388+
flags.DEFINE_string(
389+
'stress_ng_vm_bytes',
390+
'1G',
391+
'Size of the VM to run the "vm" stressor on.'
392+
)
383393

384394
ALL_WORKLOADS = ['small', 'medium', 'large']
385395
flags.DEFINE_list(
@@ -553,6 +563,19 @@ def _RunWorkload(vm, num_threads):
553563
])
554564
metadata['memrate_wr_mib_per_s'] = memrate_wr
555565

566+
if stressor_name == 'vm':
567+
cmd_parts.extend([
568+
'--vm',
569+
str(FLAGS.stress_ng_vm_count),
570+
'--vm-bytes',
571+
str(FLAGS.stress_ng_vm_bytes),
572+
'--vm-keep',
573+
'--vm-hang',
574+
'0',
575+
])
576+
metadata['vm_count'] = FLAGS.stress_ng_vm_count
577+
metadata['vm_bytes'] = FLAGS.stress_ng_vm_bytes
578+
556579
cmd = ' '.join(cmd_parts)
557580
stdout, _ = vm.RemoteCommand(cmd)
558581
stressng_sample = _ParseStressngResult(metadata, stdout)

0 commit comments

Comments
 (0)