File tree Expand file tree Collapse file tree 3 files changed +28
-7
lines changed Expand file tree Collapse file tree 3 files changed +28
-7
lines changed Original file line number Diff line number Diff line change 3
3
source ci/lib.sh || exit 1
4
4
5
5
mkdir -p profs
6
+
6
7
go test --vet=off --run=^$ -bench=. \
8
+ -cpuprofile=profs/cpu \
9
+ -memprofile=profs/mem \
10
+ -blockprofile=profs/block \
11
+ -mutexprofile=profs/mutex \
7
12
./...
8
- # -cpuprofile=profs/cpu \
9
- # -memprofile=profs/mem \
10
- # -blockprofile=profs/block \
11
- # -mutexprofile=profs/mutex \
12
13
13
14
set +x
14
15
echo " profiles are in ./profs
Original file line number Diff line number Diff line change @@ -18,6 +18,19 @@ function docker_run() {
18
18
" ${IMAGE} "
19
19
}
20
20
21
+ function help() {
22
+ set +x
23
+ echo
24
+ echo " $0 [-h] <step>"
25
+ cat << EOF
26
+
27
+ If you do not pass in an explicit step, all steps will be ran in order.
28
+ Pass "analyze" as the step to be put into an interactive container to analyze
29
+ profiles.
30
+ EOF
31
+ exit 1
32
+ }
33
+
21
34
# Use this to analyze benchmark profiles.
22
35
if [[ ${1-} == " analyze" ]]; then
23
36
docker run \
@@ -29,7 +42,15 @@ if [[ ${1-} == "analyze" ]]; then
29
42
golang:1.12
30
43
fi
31
44
45
+ if [[ ${1-} == " -h" || ${1-} == " --help" || ${1-} == " help" ]]; then
46
+ help
47
+ fi
48
+
32
49
if [[ $# -gt 0 ]]; then
50
+ if [[ ! -d " ci/$* " ]]; then
51
+ help
52
+ fi
53
+
33
54
docker_run " ci/$* "
34
55
exit 0
35
56
fi
Original file line number Diff line number Diff line change @@ -16,10 +16,9 @@ go tool cover -func=profs/coverage
16
16
if [[ $CI ]]; then
17
17
bash <( curl -s https://codecov.io/bash) -f profs/coverage
18
18
else
19
- go tool cover -html=profs/coverage -o=coverage.html
19
+ go tool cover -html=profs/coverage -o=profs/ coverage.html
20
20
21
21
set +x
22
22
echo
23
- echo " please open coverage.html to see detailed test coverage stats"
24
- echo " profiles are in ./prof/"
23
+ echo " please open profs/coverage.html to see detailed test coverage stats"
25
24
fi
You can’t perform that action at this time.
0 commit comments