Revert "Revert "Improve metric summarization performance under heavy load""

This reverts commit 50a51f2f1464a59c9552d6648222b80d12a0b09e.