console-redirect

How can I run FIO for windows and redirect output to file and console simultaneously


I’m running FIO 2.1.8 (Windows 2012 R2) and I am trying to figure out how I can use a bat file with FIO and the –output= command, but also display the output to the console screen at the same time.

I want to be able to monitor the screen in real time but also need a log so I can parse for errors and metrics after the workload is done. The problem is it seems there is no way to do both.

If I include the output argument then all screen output is suppressed, and if I try to do any other type of redirection then the console never updates.

Does anyone know how to achieve this with FIO in Windows?

I've tried using

In all cases this does not work.

"C:\Program Files\fio\fio.exe" --name=warmup --readwrite=randrw --rwmixread=70 --bs=64k --ba=64k --filename=E\:\FIO_
datafile.dat --size=32m --ioengine=windowsaio  --runtime=900 --time_based --iodepth=4 --numjobs=32  --eta=always

Thanks...


Solution

  • PowerShell's Tee-Object worked for me:

    & ./fio --eta=always --ioengine=null --thread --time_based --runtime=10s --size=1M --name=go | Tee-Object fioout.txt
    

    (An aside: due to the way Windows works you don't exactly have pseudo-ttys so it's often hard for other programs to pretend to be terminals in a way the originating program won't detect as being a redirection to a file)