Skip to content

Commit

Permalink
Adds a benchmark suite (#231)
Browse files Browse the repository at this point in the history
  • Loading branch information
petethepig committed Jun 2, 2021
1 parent 81ba6c4 commit c7cab40
Show file tree
Hide file tree
Showing 31 changed files with 17,141 additions and 34 deletions.
6 changes: 6 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ third_party/*/target
webapp/public/*
node_modules
.git/

benchmark/Dockerfile
benchmark/runs
benchmark/docker-compose.yml
benchmark/grafana-*
benchmark/node_modules
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/webapp/public/**
/webapp/javascript/util/**
/webapp/__tests__/**
/benchmark/**
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ pkged.go
.idea
.vscode
vendor/
benchmark/git-info.env
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ COPY third_party/rustdeps/pyspy.h /opt/pyroscope/third_party/rustdeps/pyspy.h
COPY third_party/phpspy/phpspy.h /opt/pyroscope/third_party/phpspy/phpspy.h
COPY --from=phpspy-builder /var/www/html/phpspy/libphpspy.a /opt/pyroscope/third_party/phpspy/libphpspy.a
COPY --from=js-builder /opt/pyroscope/webapp/public ./webapp/public
COPY pkg ./pkg
COPY cmd ./cmd
COPY Makefile ./
COPY tools ./tools
COPY scripts ./scripts
COPY go.mod go.sum pyroscope.go ./
COPY Makefile ./
RUN make install-dev-tools

COPY pkg ./pkg
COPY cmd ./cmd

RUN EMBEDDED_ASSETS_DEPS="" EXTRA_LDFLAGS="-linkmode external -extldflags '-static'" make build-release

Expand Down
12 changes: 12 additions & 0 deletions benchmark/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM golang:1.15.6

WORKDIR /go/src/app

COPY go.mod go.sum pyroscope.go ./
RUN go get -d ./

COPY ./pkg pkg
COPY ./benchmark benchmark

RUN go build -o benchmark-main ./benchmark
CMD ["./benchmark-main"]
28 changes: 28 additions & 0 deletions benchmark/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## Prerequisites

* docker-compose
* puppeteer and Google Chrome for screenshots


## Usage

To start benchmark run:
```
sh start.sh
```
Pass `--wait` to make the system continue running after benchmarking is over:
```
sh start.sh --wait
```


## Configuration

Edit `run-parameters.env` file to change the parameters of the benchmark run.


## Browsing results

To view results open [http://localhost:8080/d/65gjqY3Mk/main?orgId=1](http://localhost:8080/d/65gjqY3Mk/main?orgId=1).

You will also be able to see screenshots of the runs in `./runs` directory
42 changes: 42 additions & 0 deletions benchmark/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
version: "3.9"
services:
client:
env_file:
- git-info.env
- run-parameters.env
ports:
- 8081:8081
build:
context: ../
dockerfile: benchmark/Dockerfile

pyroscope:
environment:
- PYROSCOPE_LOG_LEVEL=debug
build:
context: ../
dockerfile: Dockerfile
command:
- server
ports:
- 4040:4040
deploy:
resources:
limits:
cpus: 1
memory: 512M

prometheus:
image: prom/prometheus:v2.27.1
volumes:
- ./prometheus:/etc/prometheus/
ports:
- 9090:9090

grafana:
image: grafana/grafana:7.5.7
volumes:
- ./grafana-provisioning:/etc/grafana/provisioning
- ./grafana-docker/grafana.ini:/etc/grafana/grafana.ini
ports:
- 8080:3000

0 comments on commit c7cab40

Please sign in to comment.