Skip to content

Instantly share code, notes, and snippets.

@nmasse-itix
Created May 26, 2017 09:18
Show Gist options
  • Save nmasse-itix/af7170da295a64b80148e0d73eb7be80 to your computer and use it in GitHub Desktop.
Save nmasse-itix/af7170da295a64b80148e0d73eb7be80 to your computer and use it in GitHub Desktop.
Script to monitor disk write times
#!/bin/bash
# Send stats to this file
exec 23>> stats.csv
while sleep 30; do
date="$(date -Iseconds)"
real=""
user=""
sys=""
t="$(time -p (dd if=/dev/urandom of=stats.bin bs=1M count=1 conv=fsync &>/dev/null) 2>&1 >/dev/null)"
echo $t |(read dummy real dummy user dummy sys && echo "$date,$real,$user,$sys") 1>&23
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment