Code for generating some metrics about data