Skip to content

Instantly share code, notes, and snippets.

@arungpro
Created July 10, 2020 14:02
Show Gist options
  • Save arungpro/eabc11e91e158bec2039ecdc67e50e9d to your computer and use it in GitHub Desktop.
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 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