forked from distributed-system-analysis/smallfile
-
Notifications
You must be signed in to change notification settings - Fork 1
/
profile.sh
24 lines (24 loc) · 839 Bytes
/
profile.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
#!/bin/bash -x
#
# script to run python profile module to profile some smallfile workloads
#
top=/run/ben/smfprofile
if [ ! -d $top ] ; then
python ./smallfile_cli.py --top $top --threads 1 --files 100000 --file-size 1 --operation cleanup
python ./smallfile_cli.py --top $top --threads 1 --files 100000 --file-size 1 --operation create
fi
touch $top/network_shared/starting_gate
OPNAME=read COUNT=100000 TOP=$top python <<EOF > read-profile.log
import profile
profile.run('import profile_workload', 'profile.tmp')
import pstats
p = pstats.Stats('profile.tmp')
p.sort_stats('cumulative').print_stats()
EOF
OPNAME=append COUNT=100000 TOP=$top python <<EOF > append-profile.log
import profile
profile.run('import profile_workload', 'profile.tmp')
import pstats
p = pstats.Stats('profile.tmp')
p.sort_stats('cumulative').print_stats()
EOF