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 <roman@victoriametrics.com>

* Apply suggestions from code review

* Apply suggestions from code review

* Apply suggestions from code review

Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
This commit is contained in:
Roman Khavronenko 2022-02-18 12:23:36 +02:00 committed by GitHub
parent 10590bde47
commit 3ac3124eed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 95 additions and 32 deletions

View File

@ -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):
<div class="with-copy" markdown="1">
```bash
curl -s http://<victoria-metrics-host>: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:
</div>
* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed):
<div class="with-copy" markdown="1">
```bash
curl -s http://<victoria-metrics-host>:8428/debug/pprof/profile > cpu.pprof
curl http://0.0.0.0:8428/debug/pprof/profile > cpu.pprof
```
</div>
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).

View File

@ -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):
<div class="with-copy" markdown="1">
```bash
curl -s http://<vmagent-host>: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:
</div>
* CPU profile can be collected with the following command (replace `0.0.0.0` with hostname if needed):
<div class="with-copy" markdown="1">
```bash
curl -s http://<vmagent-host>:8429/debug/pprof/profile > cpu.pprof
curl http://0.0.0.0:8429/debug/pprof/profile > cpu.pprof
```
</div>
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).

View File

@ -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):
<div class="with-copy" markdown="1">
```bash
curl -s http://<vmauth-host>: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:
</div>
* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed):
<div class="with-copy" markdown="1">
```bash
curl -s http://<vmauth-host>:8427/debug/pprof/profile > cpu.pprof
curl http://0.0.0.0:8427/debug/pprof/profile > cpu.pprof
```
</div>
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).

View File

@ -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):
<div class="with-copy" markdown="1">
```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`:
</div>
Example command for collecting memory profile from `vminsert` (replace `0.0.0.0` with `vminsert` hostname if needed):
<div class="with-copy" markdown="1">
```bash
curl -s http://vminsert:8480/debug/pprof/heap > mem.pprof
curl http://0.0.0.0:8480/debug/pprof/heap > mem.pprof
```
</div>
## Community and contributions

View File

@ -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):
<div class="with-copy" markdown="1">
```bash
curl -s http://<victoria-metrics-host>: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:
</div>
* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed):
<div class="with-copy" markdown="1">
```bash
curl -s http://<victoria-metrics-host>:8428/debug/pprof/profile > cpu.pprof
curl http://0.0.0.0:8428/debug/pprof/profile > cpu.pprof
```
</div>
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).

View File

@ -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):
<div class="with-copy" markdown="1">
```bash
curl -s http://<victoria-metrics-host>: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:
</div>
* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed):
<div class="with-copy" markdown="1">
```bash
curl -s http://<victoria-metrics-host>:8428/debug/pprof/profile > cpu.pprof
curl -s http://0.0.0.0:8428/debug/pprof/profile > cpu.pprof
```
</div>
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).

View File

@ -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):
<div class="with-copy" markdown="1">
```bash
curl -s http://<vmagent-host>: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:
</div>
* CPU profile can be collected with the following command (replace `0.0.0.0` with hostname if needed):
<div class="with-copy" markdown="1">
```bash
curl -s http://<vmagent-host>:8429/debug/pprof/profile > cpu.pprof
curl http://0.0.0.0:8429/debug/pprof/profile > cpu.pprof
```
</div>
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).

View File

@ -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):
<div class="with-copy" markdown="1">
```bash
curl -s http://<vmauth-host>: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:
</div>
* CPU profile. It can be collected with the following command (replace `0.0.0.0` with hostname if needed):
<div class="with-copy" markdown="1">
```bash
curl -s http://<vmauth-host>:8427/debug/pprof/profile > cpu.pprof
curl http://0.0.0.0:8427/debug/pprof/profile > cpu.pprof
```
</div>
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).