TrackerApp.StressTest.StressTest C# (CSharp) Method

StressTest() public method

public StressTest ( int torrents, int requests ) : System
torrents int
requests int
return System
        public StressTest(int torrents, int requests)
        {
            for (int i = 0; i < torrents; i++)
            {
                var infoHash = new byte[20];
                _random.NextBytes(infoHash);
                _hashes.Add(new InfoHash(infoHash).UrlEncode());
            }

            _threadSleepTime = Math.Max((int) (20000.0/requests + 0.5), 1);
            _threads = new Thread[20];
        }