fixed cache
diff --git a/scripts/benchmark.sh b/scripts/benchmark.sh
index 1cc3b93..1d3a6ac 100755
--- a/scripts/benchmark.sh
+++ b/scripts/benchmark.sh
@@ -1,19 +1,23 @@
#!/bin/sh
+rm -rf create.log delete.log
+
./addDPN.sh 1 &> /dev/null
for (( i=1; i<=100; i++)); do
- ./configureCreateOrUpdate.sh create $i 1 &> /dev/null &
+ ./configure.sh create $i 1 >> create.log 2> /dev/null &
if ! (($i % 10)); then
wait
fi
done
-#for (( i=1; i<=100; i++)); do
-# ./configureDeleteOrQuery.sh delete $i &> /dev/null &
-# if ! (($i % 10)); then
-# wait
-# fi
-#done
+wait
+
+for (( i=1; i<=100; i++)); do
+ ./configure.sh delete $i >> delete.log 2> /dev/null &
+ if ! (($i % 10)); then
+ wait
+ fi
+done
./deleteDPN.sh 1 &> /dev/null
diff --git a/scripts/configureCreateOrUpdate.sh b/scripts/configure.sh
similarity index 71%
rename from scripts/configureCreateOrUpdate.sh
rename to scripts/configure.sh
index 5ce3bbe..a77d853 100755
--- a/scripts/configureCreateOrUpdate.sh
+++ b/scripts/configure.sh
@@ -1,6 +1,30 @@
#!/bin/bash
-if [ "$#" -eq 3 ]; then
+if [ "$#" -eq 2 ] && [ $1 == "delete" ]; then
+ echo ""
+ json='{
+ "input": {
+ "op-id": '$2',
+ "targets": [
+ {
+ "target": "/ietf-dmm-fpcagent:tenants/tenant=default/fpc-mobility/contexts='$2'"
+ }
+ ],
+ "client-id": "1",
+ "session-state": "complete",
+ "admin-state": "enabled",
+ "op-type": "'$1'",
+ "op-ref-scope": "none"
+ }
+ }'
+
+ curl -X POST \
+ --header 'Content-Type: application/json' \
+ -u onos:rocks \
+ --header 'Accept: application/json' \
+ -d "$json" \
+ 'http://localhost:8181/onos/restconf/operations/ietf-dmm-fpcagent:configure' | python -m json.tool
+elif [ "$#" -eq 3 ] && [ $1 == "create" ]; then
echo ""
json='{
"input": {
@@ -46,7 +70,7 @@
}
}
],
- "op-id": "1",
+ "op-id": '$2',
"op-ref-scope": "op",
"op-type": "'$1'",
"session-state": "complete"
@@ -61,5 +85,5 @@
'http://localhost:8181/onos/restconf/operations/ietf-dmm-fpcagent:configure' | python -m json.tool
echo ""
else
- echo "usage: "$0" type contextId dpnId"
+ echo "usage: "$0" type contextId"
fi
\ No newline at end of file
diff --git a/scripts/configureDeleteOrQuery.sh b/scripts/configureDeleteOrQuery.sh
deleted file mode 100755
index 5735d72..0000000
--- a/scripts/configureDeleteOrQuery.sh
+++ /dev/null
@@ -1,29 +0,0 @@
-#!/bin/bash
-
-if [ "$#" -eq 2 ]; then
- echo ""
- json='{
- "input": {
- "op-id": "3",
- "targets": [
- {
- "target": "/ietf-dmm-fpcagent:tenants/tenant=default/fpc-mobility/contexts='$2'"
- }
- ],
- "client-id": "1",
- "session-state": "complete",
- "admin-state": "enabled",
- "op-type": "'$1'",
- "op-ref-scope": "none"
- }
- }'
-
- curl -X POST \
- --header 'Content-Type: application/json' \
- -u onos:rocks \
- --header 'Accept: application/json' \
- -d "$json" \
- 'http://localhost:8181/onos/restconf/operations/ietf-dmm-fpcagent:configure' | python -m json.tool
-else
- echo "usage: "$0" type contextId"
-fi
\ No newline at end of file