Debian Codegraph @

nfsometerlib/workloads/filebench_webserver.nfsometer

raw
1 #
2 # RUNDIR - a newly created directory on the nfs share.
3 # will exist only when running COMMAND.
4 #
5 # LOCALDIR - a directory on the local fs meant to serve as storage space for
6 # the fetch stage and setup() call
7 # will exist for setup, fetch stages and when COMMAND is run, but
8 # not durning check().
9 #
10
11 FB_WORKLOAD=webserver.f
12 FB_RUNTIME=300
13
14 FB_SOURCE="/usr/share/filebench/workloads/$FB_WORKLOAD"
15 FB_FILE="nfsometer-$FB_WORKLOAD"
16
17 #
18 # the command to run
19 #
20 COMMAND="cd $LOCALDIR && filebench -f $FB_FILE"
21
22 #
23 # command description
24 #
25 DESCRIPTION="A 5 minute run of the webserver workload from the filebench test suite"
26
27 # workload_check()
28 # - no arguments
29 # - any output to stdout means the check failed
30 # - use need_* functions from workloads.sh
31 workload_check()
32 {
33 need_bin filebench
34 need_file $FB_SOURCE
35 }
36
37 # workload_setup()
38 # - no arguments
39 # - non-zero return indicates a problem
40 workload_setup()
41 {
42 sudo sh -c "echo 0 > /proc/sys/kernel/randomize_va_space"
43
44 cp $FB_SOURCE ./$FB_FILE || return 1
45 echo "set \$dir = $RUNDIR" >> ./$FB_FILE || return 1
46 echo "run $FB_RUNTIME" >> ./$FB_FILE || return 1
47
48 return 0
49 }
50