fix metrics init for percentile type
Fix percentile emission. Also include the average for percentile