fix bug where last partition would be saved as latest metrics for all partitions