# Path: amivapi/settings.py
# DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ"


from amivapi.settings import DATE_FORMAT
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
from io import BytesIO
from itertools import count
from time import sleep, time
from sys import argv, stdout
import random
import requests
import statistics
import traceback
    """ Simulate one user signing up for an event """
    user = random.choice(SESSIONS)

    events = get(BASE_URL + '/events').json()['_items']

    event = random.choice(events)

    data = {
        'user': user['id'],
        'event': event['_id']
    }
    post(BASE_URL + '/eventsignups', data=data,
         auth=(user['token'], ''))


#
# Test functions
#

def do_random_get():
    """ Do a random request, however only do GET requests.
    (those might use caching)"""
    try:
        random.choice([get_events,
                       get_studydocs,
                       download_random_studydoc])()
    except Exception as e:
        traceback.print_exc()



# Path: amivapi/settings.py
# DATE_FORMAT = "%Y-%m-%dT%H:%M:%SZ"


# Path: test_performance.py
from amivapi.settings import DATE_FORMAT
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
from io import BytesIO
from itertools import count
from time import sleep, time
from sys import argv, stdout
import random
import requests
import statistics
import traceback

    """ Simulate one user signing up for an event """
    user = random.choice(SESSIONS)

    events = get(BASE_URL + '/events').json()['_items']

    event = random.choice(events)

    data = {
        'user': user['id'],
        'event': event['_id']
    }
    post(BASE_URL + '/eventsignups', data=data,
         auth=(user['token'], ''))


#
# Test functions
#

def do_random_get():
    """ Do a random request, however only do GET requests.
    (those might use caching)"""
    try:
        random.choice([get_events,
                       get_studydocs,
                       download_random_studydoc])()
    except Exception as e:
        traceback.print_exc()



def do_random_all():