コード例 #1
0
ファイル: test.py プロジェクト: kouroshparsa/iis_bridge
 def test_site_pool(self):
     site.create(self.test_site, get_free_port(),\
                 r"C:\inetpub\wwwroot\mysite", self.test_pool)
     time.sleep(2)
     assert self.test_site in iis.get_site_names(), "Failed to create the site"
     assert self.test_pool in iis.get_pool_names(), "Failed to create the pool"
     site.delete(self.test_site)
     pool.delete(self.test_pool)
     assert self.test_site not in iis.get_site_names(), "Failed to delete the site"
     assert self.test_pool not in iis.get_pool_names(), "Failed to delete the pool"
コード例 #2
0
 def test_site_pool(self):
     site.create(self.test_site, get_free_port(),\
                 r"C:\inetpub\wwwroot\mysite", self.test_pool)
     time.sleep(2)
     assert self.test_site in iis.get_site_names(
     ), "Failed to create the site"
     assert self.test_pool in iis.get_pool_names(
     ), "Failed to create the pool"
     site.delete(self.test_site)
     pool.delete(self.test_pool)
     assert self.test_site not in iis.get_site_names(
     ), "Failed to delete the site"
     assert self.test_pool not in iis.get_pool_names(
     ), "Failed to delete the pool"
コード例 #3
0
def monitor_with_load(iterations, urls, rate,\
        mem_type='WorkingSetPrivate', mem_unit='KB', timeout=15):
    """ generates an http load and monitors the memory consumption
    iterations: how many iterations to perform (load duration)
    urls: list of urls to send requests to
    rate: an integer representing how many requests to send per second
    mem_type: (optional) what type of memory you'd like to monitor
    mem_unit: (optional) the memory units
    timeout: http request timeout in second
    output_path: where to save the html report
    """
    if urls == 'all':
        urls = [site.get_url(name) for name in iis.get_site_names()]
    interval = 1 # per second
    http_thread = load_gen.HttpFlood(iterations,\
        urls, rate, interval=interval, timeout=timeout)
    http_thread.daemon = True
    http_thread.start()
    print("Starting to send http requests and monitor the memory usage...")
    datasets = monitor(total_length=iterations,\
        mem_type=mem_type, mem_unit=mem_unit, delta=interval)
    http_thread.join()
    print("%i/%i requests Failed."\
          % (http_thread.failed_reqs, int(rate * iterations / interval)))
    return datasets
コード例 #4
0
 def setUpClass(self):
     if not os.path.exists('%s\\InetMgr.exe' % config.IIS_HOME):
         iis.install()
     self.test_site = 'test_site'
     count = 2
     while self.test_site in iis.get_site_names():
         self.test_site = "test_site_%i" % count
         count += 1
     self.test_pool = self.test_site.replace("site", "pool")
コード例 #5
0
ファイル: test.py プロジェクト: kouroshparsa/iis_bridge
 def setUpClass(self):
     if not os.path.exists('%s\\InetMgr.exe' % config.IIS_HOME):
         iis.install()
     self.test_site = 'test_site'
     count = 2
     while self.test_site in iis.get_site_names():
         self.test_site = "test_site_%i" % count
         count += 1
     self.test_pool = self.test_site.replace("site", "pool")