Creating aggregated metrics

Now with proper handeling of the iterator