openwhisk-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From markusthoem...@apache.org
Subject [incubator-openwhisk-performance] 20/22: Refactor the repository to make each test independent
Date Wed, 16 Aug 2017 09:24:00 GMT
This is an automated email from the ASF dual-hosted git repository.

markusthoemmes pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-openwhisk-performance.git

commit da0a8819b0f6848e920d155c4fefd9cb0fbba057
Author: Markus Thoemmes <markus.thoemmes@de.ibm.com>
AuthorDate: Tue Apr 25 10:50:21 2017 +0200

    Refactor the repository to make each test independent
---
 .travis.yml         |  3 ++-
 README.md           | 12 +-----------
 test.sh             | 22 ----------------------
 tests/create.sh     | 17 +++++++++++++++++
 tests/latency.sh    | 16 ++++++++++++++++
 tests/throughput.sh | 19 +++++++++++++++++++
 6 files changed, 55 insertions(+), 34 deletions(-)

diff --git a/.travis.yml b/.travis.yml
index 845c8a6..6f256d3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,4 +10,5 @@ install:
   - ./deploy.sh
 
 script:
-  - ./test.sh "http://172.17.0.1:10001" "$(cat openwhisk/ansible/files/auth.guest)" 8
\ No newline at end of file
+  - ./tests/latency.sh "http://172.17.0.1:10001" "$(cat openwhisk/ansible/files/auth.guest)"
+  - ./tests/throughput.sh "http://172.17.0.1:10001" "$(cat openwhisk/ansible/files/auth.guest)"
4
\ No newline at end of file
diff --git a/README.md b/README.md
index 7b4c214..5e35629 100644
--- a/README.md
+++ b/README.md
@@ -30,14 +30,4 @@ The throughput test determines the maximum throughput a user can get out
of the
 - noop action
 
 ## Running the suites yourself
-To run the suites against your own system (or any other OpenWhisk deployment really), simply
use the `test.sh` script.
-
-It takes a couple of parameters, defined as follows:
-
-```
-> test.sh HOST CREDENTIALS CONCURRENCY_LEVEL
-```
-
-- **HOST**: The host to reach OpenWhisk. Should include the protocol (`http`/`https`) and
the port if applicable.
-- **CREDENTIALS**: Credentials for OpenWhisk in USER:PASS form.
-- **CONCURRENCY_LEVEL**: Concurrency level for the loadtest. This number should be a multiple
of the number of CPU cores all invoker machines have in total.
\ No newline at end of file
+To run the suites against your own system (or any other OpenWhisk deployment really), simply
use the repsective script in `/tests` script. Their parameters are defined inline in the respective
file.
\ No newline at end of file
diff --git a/test.sh b/test.sh
deleted file mode 100755
index 2dbf029..0000000
--- a/test.sh
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/sh
-set -e
-
-host=$1
-credentials=$2
-concurrency=$3
-
-action="noop"
-
-# create a noop action
-echo "Creating noop action"
-curl -u "$credentials" "$host/api/v1/namespaces/_/actions/$action" -XPUT -d '{"namespace":"_","name":"test","exec":{"kind":"nodejs:default","code":"function
main(){return {};}"}}' -H "Content-Type: application/json"
-
-# run the noop action
-echo "Running noop action once to assert an intact system"
-curl -u "$credentials" "$host/api/v1/namespaces/_/actions/$action?blocking=true" -XPOST
-
-# run latency tests
-docker run --rm markusthoemmes/loadtest loadtest -n 10000 -k -m POST -H "Authorization: basic
$(echo $credentials | base64 -w 0)" "$host/api/v1/namespaces/_/actions/$action?blocking=true"
-
-# run maximum throughput tests
-docker run --rm markusthoemmes/loadtest loadtest -n 10000 -c "$concurrency" -k -m POST -H
"Authorization: basic $(echo $credentials | base64 -w 0)" "$host/api/v1/namespaces/_/actions/$action?blocking=true"
\ No newline at end of file
diff --git a/tests/create.sh b/tests/create.sh
new file mode 100755
index 0000000..9198a9a
--- /dev/null
+++ b/tests/create.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+
+# Host to use. Needs to include the protocol.
+host=$1
+# Credentials to use for the test. USER:PASS format.
+credentials=$2
+# Name of the action to create and test.
+action=$3
+
+# create a noop action
+echo "Creating action $action"
+curl -u "$credentials" "$host/api/v1/namespaces/_/actions/$action" -XPUT -d '{"namespace":"_","name":"test","exec":{"kind":"nodejs:default","code":"function
main(){return {};}"}}' -H "Content-Type: application/json"
+
+# run the noop action
+echo "Running $action once to assert an intact system"
+curl -u "$credentials" "$host/api/v1/namespaces/_/actions/$action?blocking=true" -XPOST
\ No newline at end of file
diff --git a/tests/latency.sh b/tests/latency.sh
new file mode 100755
index 0000000..3078be9
--- /dev/null
+++ b/tests/latency.sh
@@ -0,0 +1,16 @@
+#!/bin/sh
+set -e
+
+# Host to use. Needs to include the protocol.
+host=$1
+# Credentials to use for the test. USER:PASS format.
+credentials=$2
+# How many samples to create by the test. Default: 10000
+samples=${3:-10000} # default value of 10000
+
+action="noopLatency"
+./create.sh "$host" "$credentials" "$action"
+
+# run latency tests
+encodedAuth=$(echo "$credentials" | base64 -w 0)
+docker run --rm markusthoemmes/loadtest loadtest -n "$samples" -k -m POST -H "Authorization:
basic $encodedAuth" "$host/api/v1/namespaces/_/actions/$action?blocking=true"
\ No newline at end of file
diff --git a/tests/throughput.sh b/tests/throughput.sh
new file mode 100755
index 0000000..bf002c3
--- /dev/null
+++ b/tests/throughput.sh
@@ -0,0 +1,19 @@
+#!/bin/sh
+set -e
+
+# Host to use. Needs to include the protocol.
+host=$1
+# Credentials to use for the test. USER:PASS format.
+credentials=$2
+# concurrency level of the throughput test: How many requests should
+# open in parallel.
+concurrency=$3
+# How many samples to create by the test. Default: 10000
+samples=${4:-10000}
+
+action="noopThroughput"
+./create.sh "$host" "$credentials" "$action"
+
+# run throughput tests
+encodedAuth=$(echo "$credentials" | base64 -w 0)
+docker run --rm markusthoemmes/loadtest loadtest -n "$samples" -c "$concurrency" -k -m POST
-H "Authorization: basic $encodedAuth" "$host/api/v1/namespaces/_/actions/$action?blocking=true"
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@openwhisk.apache.org" <commits@openwhisk.apache.org>.

Mime
View raw message