implementing avg for each metric on global view