Skip to content

Commit 1166fa6

Browse files
authored
Minor updates for the existing benchmark process (#486)
* Minor updates for the existing process. Signed-off-by: Hiromi Suenaga <[email protected]> * Updating make clean to delete benchmark output folders Signed-off-by: Hiromi Suenaga <[email protected]> * Removing `MODE=0` from `make integration` Signed-off-by: Hiromi Suenaga <[email protected]>
1 parent bce9cd9 commit 1166fa6

File tree

5 files changed

+25
-8
lines changed

5 files changed

+25
-8
lines changed

Diff for: .gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,5 @@ examples/dyplomat/dyplomat
2020
# Benchmarking artifacts
2121
*.gz
2222
*.pprof
23+
/benchmarks/reports
24+
/benchmarks/pngs

Diff for: Makefile

+9-7
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ clean:
2020
@rm -rf $(BINDIR)
2121
@rm -rf *.log
2222
@rm -rf *.pprof
23+
@rm -rf benchmarks/reports
24+
@rm -rf benchmarks/pngs
2325

2426
# TODO(mattklein123): See the note in TestLinearConcurrentSetWatch() for why we set -parallel here
2527
# This should be removed.
@@ -63,30 +65,30 @@ $(BINDIR)/test:
6365
integration: integration.xds integration.ads integration.rest integration.xds.mux integration.xds.delta integration.ads.delta
6466

6567
integration.ads: $(BINDIR)/test $(BINDIR)/upstream
66-
env XDS=ads MODE=0 build/integration.sh
68+
env XDS=ads build/integration.sh
6769

6870
integration.xds: $(BINDIR)/test $(BINDIR)/upstream
69-
env XDS=xds MODE=0 build/integration.sh
71+
env XDS=xds build/integration.sh
7072

7173
integration.rest: $(BINDIR)/test $(BINDIR)/upstream
72-
env XDS=rest MODE=0 build/integration.sh
74+
env XDS=rest build/integration.sh
7375

7476
integration.xds.mux: $(BINDIR)/test $(BINDIR)/upstream
75-
env XDS=xds MODE=0 build/integration.sh -mux
77+
env XDS=xds build/integration.sh -mux
7678

7779
integration.xds.delta: $(BINDIR)/test $(BINDIR)/upstream
78-
env XDS=delta MODE=0 build/integration.sh
80+
env XDS=delta build/integration.sh
7981

8082
integration.ads.delta: $(BINDIR)/test $(BINDIR)/upstream
81-
env XDS=delta-ads MODE=0 build/integration.sh
83+
env XDS=delta-ads build/integration.sh
8284

8385

8486
#------------------------------------------------------------------------------
8587
# Benchmarks utilizing intergration tests
8688
#------------------------------------------------------------------------------
8789
.PHONY: benchmark docker_benchmarks
8890
benchmark: $(BINDIR)/test $(BINDIR)/upstream
89-
env XDS=xds MODE=$(MODE) build/integration.sh
91+
env XDS=xds build/integration.sh
9092

9193
docker_benchmarks:
9294
docker build --pull -f Dockerfile.ci . -t gcp_ci && \

Diff for: benchmarks/README.md

+10
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,16 @@ const (
3838
```
3939
To specifiy the mode, use `MODE` environment variable that corresponds to the output you wish to evaluate.
4040

41+
The output file will be stored at the project root with .pprof extension (e.g. `cpu.pprof`).
42+
43+
Run `pprof` tool like so which will open up a shell. From there, you can run command such as `web` to visualize the result:
44+
45+
```bash
46+
go tool pprof cpu.pprof
47+
(pprof) web
48+
```
49+
For more information, run `help`.
50+
4151
## Running With Docker
4252

4353
To run the benchmarks, we just require the prerequisite of docker and go.

Diff for: build/do_benchmarks.sh

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ make benchmark MODE=2
2121
make benchmark MODE=3
2222
make benchmark MODE=4
2323

24+
mkdir -p benchmarks/reports
25+
mkdir -p benchmarks/pngs
26+
2427
# generate our consumable pprof profiles
2528
pprof -text bin/test cpu.pprof > benchmarks/reports/cpu_text.txt
2629
pprof -tree bin/test cpu.pprof > benchmarks/reports/cpu_tree.txt

Diff for: build/integration.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ MESSAGE=$'Hi, there!\n'
1414
XDS=${XDS:-ads}
1515

1616
# pprof profiler mode
17-
MODE=${MODE:0}
17+
MODE=${MODE:-0}
1818

1919
# Number of RTDS layers.
2020
if [ "$XDS" = "ads" ]; then

0 commit comments

Comments
 (0)