Slowfs

I have just encountered a bug in Gnome that is much more visible when the hard drive is slow or overloaded and responds slowly. This gave me an idea - how about a simple transparent FUSE filesystem that does nothing else than delay, slow down and possibly reorder filesystem requests? Such a filesystem would be very useful for debugging. We developers tend to have high-performance systems and that hides many bugs, but if we could have a slower system on-demand, it will give us the ability to debug our applications better.

Even better would be a virtual machine where one could arbitrarily slow down any specific aspects of the system - slower CPU, slower hard drive, slower RAM, slower network, ...

I know that engineers of network hardware have special devices that emulate long distance and noise - you take two wireless network cards and plug cables into their antennae sockets and then plug those cables into the device. The device then makes a connection between those cables, but with emulation of a variable distance, variable antennae and variable environmental noise, so the wireless cards can be tested for distance and noise resistance right in the lab. We could do the same in software for HDD, CPU, RAM and networking - imagine having two Xen instances and putting an emulated network between them with 10 hops, 1 second latency, 20% average packet drop traffic shaping and limited top bandwidth of 100 kbit/s. Now that is a real test platform for any kinds of applications that have anything to do with networking (or HDD, CPU or RAM).

Anyone up to making that? Could someone of you use a system like that?