Profiling using JRockit Flight Recorder (Please switch on Flight Recorder using XX:+FlightRecorder)
CreateDataSource.sh
$JDK_BIN/java weblogic.WLST $SERVICE_JYTHON_DIR/createDataSourceFactory.py $1 $2 $3
DAYSTAMP=`(set \`date\`; echo $3)`_`(set \`date\`; echo $2)`_`(set \`date\`; echo $6)`_`(set \`date\`; echo $4)`
export PID=`ps -wwef | grep java | grep WLST | awk '{print $2 }'`
$JDK_BIN/jrcmd $PID start_flightrecording filename=/tmp/${WLS_RELEASE}_${WLS_BUILD}_CreateDataSourceFactory_${DAYSTAMP}.jfr &
sleep 10
createDataSourceFactory.py
import os
import jarray
URL=os.environ['ADMIN_URL']
dataSourceFactoryName=sys.argv[1]
username=sys.argv[2]
password=sys.argv[3]
dbhost=os.environ['DB_HOSTNAME']
dbport=os.environ['DB_PORT']
dbsid=os.environ['DB_SID']
#=====================================================================#
# connect to the AdminServer #
#=====================================================================#
connect( os.environ['WLS_USER'], os.environ['WLS_PW'], URL)
edit()
startEdit()
cd("/")
import time
startTime=time.time()
cmo.createJDBCDataSourceFactory(dataSourceFactoryName)
cd('/JDBCDataSourceFactories/'+dataSourceFactoryName)
set("UserName", username)
set("Password",password)
set("FactoryName", "MyFactory")
set("DriverClassName", "weblogic.jdbcx.oracle.OracleDataSource")
set("URL", "jdbc:oracle:thin:@"+dbhost+":"+dbport+":"+dbsid)
activate()
import time
endTime=time.time()
print "CreateDataSourceFactory: %.3f" % (endTime-startTime)
exit()
Tuesday, August 24, 2010
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment