#!/bin/sh

# NOTE: it's not about /proc/mdstat

# FIXME: not hardcode the path
cd /sys/dev/block/9:0/md || exit 0
grep -q 'raid[456]' level 2>/dev/null || exit 0

stat_files="stripe_cache_active stripe_cache_size"

while true; do
	echo time: $(date +%s.%N)
	grep . $stat_files  | sed 's/:/: /'

	sleep 1
done
