Skip to content

Instantly share code, notes, and snippets.

@lepinkainen
Created February 29, 2016 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lepinkainen/417caa221ef428a67541 to your computer and use it in GitHub Desktop.
Save lepinkainen/417caa221ef428a67541 to your computer and use it in GitHub Desktop.
Flexget series API performance test
import requests
from datetime import datetime
from dateutil import parser
from dateutil.relativedelta import relativedelta
host = 'localhost'
port = 9090
token = 'LOL'
get_movies_endpoint = '/api/series/?in_config=all&page=1&number_of_shows=100&sort_by=show_name&order=desc'
delete_movies_endpoint = '/api/movie_queue/{0}'
date_threshold_in_years = 4
url = 'http://{0}:{1}{2}'.format(host, port, get_movies_endpoint)
headers = {'Authorization': 'Token {0}'.format(token)}
response = requests.get(url=url, headers=headers).json()
# real 2m37.643s
# without print command
#print response
# real 2m59.810s
# with print command
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment