django-asv
django-asv copied to clipboard
Adding request response benchmarks
In the TODO file in djangobench, it was mentioned that a running test server might be required for the benchmark so I tried to do this by using a sample django project and the subprocess module
import subprocess
class Benchmark:
def setup(self):
self.process = subprocess.Popen(["python", "manage.py", "runserver"])
def teardown(self):
self.process.kill()
def time_response(self):
# benchmark...
But when I tried to access the manage.py file in the django project I got an error
LookupError: No installed app with label 'admin'
whenever I tried to run the benchmarks.
After this I tried to set it up with docker but could not find a way to provide the commit hash so that the particular commit can be installed. It can be implemented in the workflow by using the python docker SDK to build the images that use particular commit hashes of django or use a shell script to pass commits to dockerfile, and use a script to start them and further benchmark them using ASV. Shall I go with this method?
Are there any other ways in which this can be done? Should I also try options other than ASV?