Revision 3279
Added by Jing Tao over 17 years ago
bin/measure-metacat-query-performance.sh | ||
---|---|---|
1 |
#!/bin/bash |
|
2 |
#Call a java client class to query metacat automatically and metacat server |
|
3 |
#will record the performance data into a file. |
|
4 |
#Note: before running the script, user should run both "ant jar" and "ant clientjar" |
|
5 |
#in Metacat to get metaca-client.jar and metacat.jar in build directory. |
|
6 |
|
|
7 |
#variables |
|
8 |
JUNIT=/usr/local/devtools/apache-ant/lib/junit-4.3.1.jar |
|
9 |
METACAT=../build/metacat.jar |
|
10 |
METACAT_CLIENT=../build/metacat-client.jar |
|
11 |
UTILITIES=../lib/utilities.jar |
|
12 |
METACATURL=http://chico.dyndns.org:8081/knb/metacat |
|
13 |
QUERY=../test/performance_measure_query |
|
14 |
TIME=3; |
|
15 |
|
|
16 |
#copy the java client to build directory |
|
17 |
rm -rf ../build/tests/ |
|
18 |
mkdir ../build/tests |
|
19 |
mkdir ../build/tests/edu |
|
20 |
mkdir ../build/tests/edu/ucsb |
|
21 |
mkdir ../build/tests/edu/ucsb/nceas |
|
22 |
mkdir ../build/tests/edu/ucsb/nceas/metacattest |
|
23 |
cp ../test/edu/ucsb/nceas/metacattest/MetaCatQueryPerformanceTest.java ../build/tests/edu/ucsb/nceas/metacattest/. |
|
24 |
|
|
25 |
#compile the class |
|
26 |
javac -classpath $JUNIT:$METACAT:$METACAT_CLIENT:$UTILITIES ../build/tests/edu/ucsb/nceas/metacattest/MetaCatQueryPerformanceTest.java |
|
27 |
|
|
28 |
#Iterate to restart postgres and tomcat, and call java client class |
|
29 |
for (( i = 0; i < $TIME; i++)) |
|
30 |
do |
|
31 |
|
|
32 |
#run the class -- query the remote metacat |
|
33 |
java -cp $JUNIT:$METACAT:$METACAT_CLIENT:$UTILITIES:../build/tests edu.ucsb.nceas.metacattest.MetaCatQueryPerformanceTest $METACATURL $QUERY |
|
34 |
done |
|
0 | 35 |
Also available in: Unified diff
A script to call java client to query metacat. The restart tomcat and postgres part haven't done yet.