def test_socketstats(self):
        collector = self._get_collector(SocketStatsCollector)
        collector.start()
        time.sleep(1.)

        # doing some socket things as a client
        for i in range(10):
            for client in self.clients:
                client.send(b'ok')
                # client.recv(2)

        # stopping
        collector.stop()
        for s, _, _ in self.socks:
            s.close()

        # let's see what we got
        self.assertTrue(len(self.streamer.stats) > 2)

        stat = self.streamer.stats[0]
        self.assertTrue(stat['fd'] in self.fds)
        self.assertTrue(stat['reads'] > 1)
dataset/ETHPy150Open circus-tent/circus/circus/tests/test_stats_collector.py/TestCollector.test_socketstats/original