diff --git a/api/neural_activity_app/settings.py b/api/neural_activity_app/settings.py index 15e6deb..bb6c072 100644 --- a/api/neural_activity_app/settings.py +++ b/api/neural_activity_app/settings.py @@ -164,3 +164,14 @@ } DOWNLOADED_FILE_CACHE_DIR = os.path.join(BASE_DIR, "download_cache") + +REST_FRAMEWORK = { + 'DEFAULT_THROTTLE_CLASSES': [ + 'rest_framework.throttling.AnonRateThrottle', + 'rest_framework.throttling.UserRateThrottle' + ], + 'DEFAULT_THROTTLE_RATES': { + 'anon': '100/minute', + 'user': '100/minute' + } +} diff --git a/loadtesting.py b/loadtesting.py new file mode 100644 index 0000000..21f746a --- /dev/null +++ b/loadtesting.py @@ -0,0 +1,15 @@ +from molotov import scenario + +# requirement: pip install molotov +# for autosizing run: molotov --sizing loadtesting.py + +# _API = "https://neo-viewer-dev.brainsimulation.eu/blockdata/?url=https://gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/axon/File_axon_1.abf" +# _API = "http://127.0.0.1:8000/blockdata/?url=https://gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/axon/File_axon_1.abf" + +_API = "http://127.0.0.1:8000/api/blockdata/?url=https://gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/brainwaresrc/block_300ms_4rep_1clust_part_ch1.src" +# _API = "https://neo-viewer.brainsimulation.eu/api/blockdata/?url=https://gin.g-node.org/NeuralEnsemble/ephy_testing_data/raw/master/brainwaresrc/block_300ms_4rep_1clust_part_ch1.src" + +@scenario(weight=100) +async def _test(session): + async with session.get(_API) as resp: + assert resp.status == 200, resp.status