>>>x = subprocess.Popen(["fio", "--filename=/dev/sdd", "--name=job1", "--numjobs=2"], stdout=subprocess.PIPE)
But I need to capture the fio progess in realtime. I'm though of doing a threaded subprocess.stdout.readline, but it doesn't seem to update the performance data:
>>> x = subprocess.Popen(["fio", "--filename=/dev/sdd", "--name=job1", "--numjobs=2"], stdout=subprocess.PIPE)
>>> x.stdout.readline()
'job1: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1\n'
>>> x.stdout.readline()
'...\n'
>>> x.stdout.readline()
'fio-2.2.11\n'
>>> x.stdout.readline()
'Starting 2 processes\n'
>>> x.stdout.readline()
it just hangs after this.
Command line execution of fio looks like this:
[root@goblinbank tmp]# fio --filename=/dev/sdd --name=job1 --numjobs=2
job1: (g=0): rw=read, bs=4K-4K/4K-4K/4K-4K, ioengine=sync, iodepth=1
...
fio-2.2.11
Starting 2 processes
Jobs: 2 (f=2): [R(2)] [0.2% done] [246.3MB/0KB/0KB /s] [63.5K/0/0 iops] [eta 02h:26m:09s]
The text after "Jobs: 2 (f=2): [R(2)]" keeps refreshing with new values.