-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
subsystem benchmarks: add cpu profiling (#2734)
Ready-to-merge version of #2601 - Added optional CPU profiling - Updated instructions how to set up Prometheus, Pyroscope and Graphana - Added a flamegraph dashboard <img width="1470" alt="image" src="https://github.com/paritytech/polkadot-sdk/assets/27277055/c8f3b33d-3c01-4ec0-ac34-72d52325b6e6"> --------- Co-authored-by: ordian <[email protected]>
- Loading branch information
1 parent
f93f461
commit 526c81b
Showing
7 changed files
with
206 additions
and
30 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
services: | ||
grafana: | ||
image: grafana/grafana-enterprise:latest | ||
container_name: grafana | ||
restart: always | ||
networks: | ||
- subsystem-bench | ||
ports: | ||
- "3000:3000" | ||
|
||
prometheus: | ||
image: prom/prometheus:latest | ||
container_name: prometheus | ||
restart: always | ||
networks: | ||
- subsystem-bench | ||
volumes: | ||
- ./prometheus:/etc/prometheus | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
ports: | ||
- "9090:9090" | ||
- "9999:9999" | ||
|
||
pyroscope: | ||
container_name: pyroscope | ||
image: grafana/pyroscope:latest | ||
restart: always | ||
networks: | ||
- subsystem-bench | ||
ports: | ||
- "4040:4040" | ||
|
||
networks: | ||
subsystem-bench: |
11 changes: 11 additions & 0 deletions
11
polkadot/node/subsystem-bench/docker/prometheus/prometheus.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
global: | ||
scrape_interval: 5s | ||
|
||
scrape_configs: | ||
- job_name: "prometheus" | ||
static_configs: | ||
- targets: ["localhost:9090"] | ||
- job_name: "subsystem-bench" | ||
scrape_interval: 0s500ms | ||
static_configs: | ||
- targets: ['host.docker.internal:9999'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"annotations": { | ||
"list": [ | ||
{ | ||
"builtIn": 1, | ||
"datasource": { | ||
"type": "grafana", | ||
"uid": "-- Grafana --" | ||
}, | ||
"enable": true, | ||
"hide": true, | ||
"iconColor": "rgba(0, 211, 255, 1)", | ||
"name": "Annotations & Alerts", | ||
"type": "dashboard" | ||
} | ||
] | ||
}, | ||
"editable": true, | ||
"fiscalYearStartMonth": 0, | ||
"graphTooltip": 0, | ||
"id": 1, | ||
"links": [], | ||
"liveNow": false, | ||
"panels": [ | ||
{ | ||
"datasource": { | ||
"type": "grafana-pyroscope-datasource", | ||
"uid": "bc3bc04f-85f9-464b-8ae3-fbe0949063f6" | ||
}, | ||
"gridPos": { | ||
"h": 18, | ||
"w": 24, | ||
"x": 0, | ||
"y": 0 | ||
}, | ||
"id": 1, | ||
"targets": [ | ||
{ | ||
"datasource": { | ||
"type": "grafana-pyroscope-datasource", | ||
"uid": "bc3bc04f-85f9-464b-8ae3-fbe0949063f6" | ||
}, | ||
"groupBy": [], | ||
"labelSelector": "{service_name=\"subsystem-bench\"}", | ||
"profileTypeId": "process_cpu:cpu:nanoseconds:cpu:nanoseconds", | ||
"queryType": "profile", | ||
"refId": "A" | ||
} | ||
], | ||
"title": "CPU Profiling", | ||
"type": "flamegraph" | ||
} | ||
], | ||
"refresh": "", | ||
"schemaVersion": 38, | ||
"tags": [], | ||
"templating": { | ||
"list": [] | ||
}, | ||
"time": { | ||
"from": "now-6h", | ||
"to": "now" | ||
}, | ||
"timepicker": {}, | ||
"timezone": "", | ||
"title": "CPU Profiling", | ||
"uid": "c31191d5-fe2b-49e2-8b1c-1451f31d1628", | ||
"version": 1, | ||
"weekStart": "" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters