stats: Generate missing records when needed.