Skip to content

Commit

Permalink
improved demo
Browse files Browse the repository at this point in the history
  • Loading branch information
adg committed Nov 24, 2010
1 parent a55a633 commit 5498cb5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
16 changes: 15 additions & 1 deletion README
@@ -1,3 +1,17 @@
Goto - A URL shortening service

This code is the basis of the presentation 'Practical Go Programming'.
This code is the basis of the presentation 'Practical Go Programming',
available in the talk/ directory.

The accompanying code samples are in talk/code.

The code in the main directory is the full-featured URL shortener, complete
with bindings to github.com/nf/stat, a statistics-collection library.

There is a stress tester in bench/, which also depends on stat.

The demo.sh script launches the stats server (stat must be checked out and
built in ../stat), 4 goto servers (3 slaves and 1 master), and several
iterations of the stress-tester.

Run it and visit http://localhost:8090/ for a pretty graph.
13 changes: 6 additions & 7 deletions demo.sh
Expand Up @@ -20,37 +20,37 @@ sleep 1
echo "Testing the master (n=1)"
bench/bench -host=localhost:8080 -n=1 &
pid=$!
sleep 15
read
kill $pid

echo "Testing the master (n=10)"
bench/bench -host=localhost:8080 -n=10 &
pid=$!
sleep 15
read
kill $pid

echo "Testing 1 slave (n=10)"
bench/bench -host=localhost:8081 -n=10 &
pid=$!
sleep 15
read
kill $pid

echo "Testing 2 slaves (n=10)"
bench/bench -host=localhost:8081,localhost:8082 -n=10 &
pid=$!
sleep 15
read
kill $pid

echo "Testing 3 slaves (n=10)"
bench/bench -host=localhost:8081,localhost:8082,localhost:8083 -n=10 &
pid=$!
sleep 15
read
kill $pid

echo "Testing 3 slaves (n=20)"
bench/bench -host=localhost:8081,localhost:8082,localhost:8083 -n=20 &
pid=$!
sleep 30
read
kill $pid

echo "Shutting down"
Expand All @@ -59,4 +59,3 @@ kill $master_pid
kill $slave1_pid
kill $slave2_pid
kill $slave3_pid
echo "Done"

0 comments on commit 5498cb5

Please sign in to comment.