changed metric to metric with parameters as a key in aggregation