Created
July 10, 2020 14:02
-
-
Save arungpro/eabc11e91e158bec2039ecdc67e50e9d to your computer and use it in GitHub Desktop.
Demonstration of usage of Appd Python agent API's on a simple hello world script
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
# This is a Demonstration of usage of Appd Python agent API's | |
from time import sleep | |
from appdynamics.agent import api as appd | |
appd.init( | |
environ={ | |
'APPD_CONFIG_FILE':'<pah to>/appdynamics.cfg' | |
} | |
) | |
def some_method(id): | |
error = None | |
bt_handle = appd.start_bt('/pricing') | |
try: | |
print(f"Hello") | |
sleep(2) | |
except Exception as exc: | |
error = exc | |
raise | |
finally: | |
appd.end_bt(bt_handle, error) | |
for i in range(1,100): | |
some_method(i) | |
appd.shutdown() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment