Call stats generation when stop condition is reached.