From 3ac3124eedaa1a10948fe0cf380b3a90d6fefee4 Mon Sep 17 00:00:00 2001 From: Roman Khavronenko Date: Fri, 18 Feb 2022 12:23:36 +0200 Subject: [PATCH] docs: make profiling commands more copy-friendly (#2213) * docs: make profiling commands more copy-friendly The change adds `copy text` snippet to code examples and replaces hostname placeholders with `0.0.0.0`. Signed-off-by: hagen1778 * Apply suggestions from code review * Apply suggestions from code review * Apply suggestions from code review Co-authored-by: Aliaksandr Valialkin --- README.md | 16 ++++++++++++---- app/vmagent/README.md | 16 ++++++++++++---- app/vmauth/README.md | 16 ++++++++++++---- docs/Cluster-VictoriaMetrics.md | 15 +++++++++++---- docs/README.md | 16 ++++++++++++---- docs/Single-server-VictoriaMetrics.md | 16 ++++++++++++---- docs/vmagent.md | 16 ++++++++++++---- docs/vmauth.md | 16 ++++++++++++---- 8 files changed, 95 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 1a0a46e07..c829d2664 100644 --- a/README.md +++ b/README.md @@ -1500,18 +1500,26 @@ for running ingestion benchmarks based on node_exporter metrics. VictoriaMetrics provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): -* Memory profile. It can be collected with the following command: +* Memory profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8428/debug/pprof/heap > mem.pprof +curl http://0.0.0.0:8428/debug/pprof/heap > mem.pprof ``` -* CPU profile. It can be collected with the following command: +
+ +* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8428/debug/pprof/profile > cpu.pprof +curl http://0.0.0.0:8428/debug/pprof/profile > cpu.pprof ``` +
+ The command for collecting CPU profile waits for 30 seconds before returning. The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof). diff --git a/app/vmagent/README.md b/app/vmagent/README.md index a2a28e979..61cbe7216 100644 --- a/app/vmagent/README.md +++ b/app/vmagent/README.md @@ -685,18 +685,26 @@ ARM build may run on Raspberry Pi or on [energy-efficient ARM servers](https://b `vmagent` provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): -* Memory profile can be collected with the following command: +* Memory profile can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8429/debug/pprof/heap > mem.pprof +curl http://0.0.0.0:8429/debug/pprof/heap > mem.pprof ``` -* CPU profile can be collected with the following command: +
+ +* CPU profile can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8429/debug/pprof/profile > cpu.pprof +curl http://0.0.0.0:8429/debug/pprof/profile > cpu.pprof ``` +
+ The command for collecting CPU profile waits for 30 seconds before returning. The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof). diff --git a/app/vmauth/README.md b/app/vmauth/README.md index c632e4a5f..f9ed4056f 100644 --- a/app/vmauth/README.md +++ b/app/vmauth/README.md @@ -188,18 +188,26 @@ ROOT_IMAGE=scratch make package-vmauth `vmauth` provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): -* Memory profile. It can be collected with the following command: +* Memory profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8427/debug/pprof/heap > mem.pprof +curl http://0.0.0.0:8427/debug/pprof/heap > mem.pprof ``` -* CPU profile. It can be collected with the following command: +
+ +* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8427/debug/pprof/profile > cpu.pprof +curl http://0.0.0.0:8427/debug/pprof/profile > cpu.pprof ``` +
+ The command for collecting CPU profile waits for 30 seconds before returning. The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof). diff --git a/docs/Cluster-VictoriaMetrics.md b/docs/Cluster-VictoriaMetrics.md index 5c2d18a03..37cb90830 100644 --- a/docs/Cluster-VictoriaMetrics.md +++ b/docs/Cluster-VictoriaMetrics.md @@ -421,18 +421,25 @@ All the cluster components provide the following handlers for [profiling](https: * `http://vmselect:8481/debug/pprof/heap` for memory profile and `http://vmselect:8481/debug/pprof/profile` for CPU profile * `http://vmstorage:8482/debug/pprof/heap` for memory profile and `http://vmstorage:8482/debug/pprof/profile` for CPU profile -Example command for collecting cpu profile from `vmstorage`: +Example command for collecting cpu profile from `vmstorage` (replace `0.0.0.0` with `vmstorage` hostname if needed): + +
```bash -curl -s http://vmstorage:8482/debug/pprof/profile > cpu.pprof +curl http://0.0.0.0:8482/debug/pprof/profile > cpu.pprof ``` -Example command for collecting memory profile from `vminsert`: +
+ +Example command for collecting memory profile from `vminsert` (replace `0.0.0.0` with `vminsert` hostname if needed): + +
```bash -curl -s http://vminsert:8480/debug/pprof/heap > mem.pprof +curl http://0.0.0.0:8480/debug/pprof/heap > mem.pprof ``` +
## Community and contributions diff --git a/docs/README.md b/docs/README.md index 1a0a46e07..d59f07d37 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1500,18 +1500,26 @@ for running ingestion benchmarks based on node_exporter metrics. VictoriaMetrics provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): -* Memory profile. It can be collected with the following command: +* Memory profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8428/debug/pprof/heap > mem.pprof +curl -s http://0.0.0.0:8428/debug/pprof/heap > mem.pprof ``` -* CPU profile. It can be collected with the following command: +
+ +* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8428/debug/pprof/profile > cpu.pprof +curl http://0.0.0.0:8428/debug/pprof/profile > cpu.pprof ``` +
+ The command for collecting CPU profile waits for 30 seconds before returning. The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof). diff --git a/docs/Single-server-VictoriaMetrics.md b/docs/Single-server-VictoriaMetrics.md index 882075270..5682732e5 100644 --- a/docs/Single-server-VictoriaMetrics.md +++ b/docs/Single-server-VictoriaMetrics.md @@ -1504,18 +1504,26 @@ for running ingestion benchmarks based on node_exporter metrics. VictoriaMetrics provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): -* Memory profile. It can be collected with the following command: +* Memory profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8428/debug/pprof/heap > mem.pprof +curl http://0.0.0.0:8428/debug/pprof/heap > mem.pprof ``` -* CPU profile. It can be collected with the following command: +
+ +* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8428/debug/pprof/profile > cpu.pprof +curl -s http://0.0.0.0:8428/debug/pprof/profile > cpu.pprof ``` +
+ The command for collecting CPU profile waits for 30 seconds before returning. The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof). diff --git a/docs/vmagent.md b/docs/vmagent.md index c03341a20..ee3a09aa2 100644 --- a/docs/vmagent.md +++ b/docs/vmagent.md @@ -689,18 +689,26 @@ ARM build may run on Raspberry Pi or on [energy-efficient ARM servers](https://b `vmagent` provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): -* Memory profile can be collected with the following command: +* Memory profile can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8429/debug/pprof/heap > mem.pprof +curl http://0.0.0.0:8429/debug/pprof/heap > mem.pprof ``` -* CPU profile can be collected with the following command: +
+ +* CPU profile can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8429/debug/pprof/profile > cpu.pprof +curl http://0.0.0.0:8429/debug/pprof/profile > cpu.pprof ``` +
+ The command for collecting CPU profile waits for 30 seconds before returning. The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof). diff --git a/docs/vmauth.md b/docs/vmauth.md index dc6329670..91552d3f9 100644 --- a/docs/vmauth.md +++ b/docs/vmauth.md @@ -192,18 +192,26 @@ ROOT_IMAGE=scratch make package-vmauth `vmauth` provides handlers for collecting the following [Go profiles](https://blog.golang.org/profiling-go-programs): -* Memory profile. It can be collected with the following command: +* Memory profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8427/debug/pprof/heap > mem.pprof +curl http://0.0.0.0:8427/debug/pprof/heap > mem.pprof ``` -* CPU profile. It can be collected with the following command: +
+ +* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed): + +
```bash -curl -s http://:8427/debug/pprof/profile > cpu.pprof +curl http://0.0.0.0:8427/debug/pprof/profile > cpu.pprof ``` +
+ The command for collecting CPU profile waits for 30 seconds before returning. The collected profiles may be analyzed with [go tool pprof](https://github.com/google/pprof).