Added features for  more advanced collections of data and examples

Hello, 
I added some very simple code to explain how to collect stats on the input data. I think this should very useful and I added it to my wiki fork as well