Add connection sweep stats and a sweep test. #1446