CMS-4685 Implement needed metric aggregations

Implemented min, max and valuecount.