Created
April 12, 2021 23:40
-
-
Save sofianhamiti/aba9ab85f8b4fb724049eea14ca2ccf2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| try: | |
| logging.info('LOAD TESTING THE API') | |
| stats = run_load_test(host=api.api_endpoint) | |
| # get response time percentiles | |
| response_time_percentile = stats['requests']['POST_/']['response_time_percentiles'][95] | |
| logging.info(f'REPONSE TIME PERCENTILES: {response_time_percentile}') | |
| logging.info(f'LAMBDA MEMORY: {args.lambda_memory}') | |
| # we create this aggregate score to optimize both latency and lambda memory allocation (cost) | |
| aggregate_score = int(args.lambda_memory) * response_time_percentile | |
| logging.info(f'AGGREGATE SCORE: {aggregate_score}') | |
| except Exception as e: | |
| logging.error(e) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment