def worker():
    while True:
        address = queue.get()
        utils.check_website(address)

        # For each address popped, mark it as processed
        queue.task_done()
Beispiel #2
0
def worker():
    # Constantly check the queue for addresses
    while True:
        address = task_queue.get()
        check_website(address)

        task_queue.task_done()
def main():
    start_time = time.time()

    for address in WEBSITE_LIST:
        check_website(address)

    end_time = time.time()

    print("Time for SerialSquirrel: %ssecs" % (end_time - start_time))
Beispiel #4
0
# serial_squirrel.py

from websites import WEBSITE_LIST
from utils import check_website
import time

start_time = time.time()

for address in WEBSITE_LIST:
    check_website(address)

end_time = time.time()

print("Time for SerialSquirrel: %ssecs" % (end_time - start_time))

# WARNING:root:Timeout expired for
# website http://really-cool-available-domain.com
# WARNING:root:Timeout expired for
# website http://another-really-interesting-domain.co
# WARNING:root:Website http://bing.com returned status_code=405
# Time for SerialSquirrel: 15.881232261657715secs
Beispiel #5
0
import time
import utils


start_time = time.time()


for address in utils.WEBSITE_LIST:
    utils.check_website(address)

end_time = time.time()


print("Time in Serial %s sec" %(end_time - start_time))

def worker():
    while True:
        address = task_queue.get()
        check_website(address)
        task_queue.task_done()
Beispiel #7
0
def check_website_task(website):
	return check_website(website)
Beispiel #8
0
def test_invalid_site():
    site = 'feadasf.fasdf.com.au'
    (response, err), duration = utils.check_website(site)

    assert response is None
    assert type(duration) == float
Beispiel #9
0
def test_valid_site():
    site = 'https://aiven.io'
    (response, err), duration = utils.check_website(site)

    assert response.status_code == 200
    assert type(duration) == float