-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathdynamic-workload-sample.sh
executable file
·74 lines (66 loc) · 1.3 KB
/
dynamic-workload-sample.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
# httpmon accepts changing some of the command-line parameters at run-time,
# by accepting commands through stdin. This is an example script that automates
# dynamic workload generation using httpmon. httpmon's output is redirected to
# httpmon.log.
#
# Experiment parameters
#
# URL to generate load for
url="http://example.com"
#
# Experiment verbs (see below for usage)
#
function setStart {
echo [`date +%s`] start
}
function setCount {
echo [`date +%s`] count=$1
echo "count=$1" >&9
}
function setOpen {
echo [`date +%s`] open=$1
echo "open=$1" >&9
}
function setThinkTime {
echo [`date +%s`] thinktime=$1
echo "thinktime=$1" >&9
}
function setConcurrency {
echo [`date +%s`] concurrency=$1
echo "concurrency=$1" >&9
}
function setTimeout {
echo [`date +%s`] timeout=$1
echo "timeout=$1" >&9
}
#
# Initialization
#
# Create FIFO to communicate with httpmon and start httpmon
rm -f httpmon.fifo
mkfifo httpmon.fifo
./httpmon --url $url --concurrency 0 --timeout 30 --deterministic < httpmon.fifo &> httpmon.log &
exec 9> httpmon.fifo
#
# Initialize experiment
#
setOpen 1
setThinkTime 1
setTimeout 4
setCount 120900
setStart
#
# Run experiment
#
setConcurrency 326
sleep 100
setConcurrency 15
sleep 100
setConcurrency 382
sleep 100
setConcurrency 473
sleep 100
setConcurrency 13
sleep 100
sleep 10