controller will pass in data to calculateMetrics.