diff --git a/scripts/debug_apy.py b/scripts/debug_apy.py index 7531feb41..1381673cb 100644 --- a/scripts/debug_apy.py +++ b/scripts/debug_apy.py @@ -1,3 +1,6 @@ +import os +import sys +import time import logging import os import traceback @@ -8,12 +11,14 @@ def main(address): from yearn.apy.common import get_samples + start = time.perf_counter() from yearn.v2.registry import Registry from yearn.v2.vaults import Vault registry = Registry() vault = Vault.from_address(address) vault.registry = registry - print(await_awaitable(vault.apy(get_samples()))) + logger.info(f'apy {str(await_awaitable(vault.apy(get_samples())))}') + logger.info(f' ⏱️ {time.perf_counter() - start} seconds') def with_exception_handling(): address = os.getenv("DEBUG_ADDRESS", None) @@ -31,3 +36,6 @@ def with_exception_handling(): logger.info("*** Available variables for debugging ***") available_variables = [ k for k in locals().keys() if '__' not in k and 'pdb' not in k and 'self' != k and 'sys' != k ] logger.info(available_variables) + +if __name__ == '__main__': + globals()[sys.argv[1]]()