Channel monitoring/statistics

Thanks Julian. I think the overhead can be managed (e.g. for take! you can record a time with a certain probability, or for channel length you could add channels to a list and have a separate task poll and record channel length and sleep). But indeed if there’s nothing that already exists I’ll roll my own stuff. I’m also aware that adding this extra tracking might even affect timing and as such the thread dynamics that happens without tracking.

I’m curious to hear whether this idea sounds like a generally sane thing, or completely misguided and there are better ways to debug asynchronous/threaded code. Any thoughts?