-
-
Save kylefurlong/920b9824a8c0cf933e416fde5eb040cf to your computer and use it in GitHub Desktop.
Python Agent API example
This file contains 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
#!/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