Skip to content

Instantly share code, notes, and snippets.

@kylefurlong
Last active November 1, 2019 19:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylefurlong/920b9824a8c0cf933e416fde5eb040cf to your computer and use it in GitHub Desktop.
Save kylefurlong/920b9824a8c0cf933e416fde5eb040cf to your computer and use it in GitHub Desktop.
Python Agent API example
#!/usr/bin/python
import sys
import time
from appdynamics.agent import api as appd
appd_env = { 'APPD_CONFIG_FILE': '/home/stevew/code/python/appd.config' }
print 'Starting Appd'
if appd.init(appd_env, 5000):
print 'Started'
else:
print 'Failed'
sys.exit(1)
for x in range(20):
print 'Starting BT'
mybt = appd.start_bt('dostuff')
time.sleep(2)
appd.end_bt(mybt)
print 'BT finished'
time.sleep(1)
appd.shutdown()
print 'Bye'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment