Simplify calculation of prometheus metrics for garbage collection.