Created How to use debug api (markdown)

Larvan2 2023-01-30 20:36:43 +08:00
parent 1d88b9a1d6
commit 97c7f1493e

36
How-to-use-debug-api.md Normal file

@ -0,0 +1,36 @@
### Get this repo
```
git clone -b alpha https://github.com/MetaCubeX/Clash.Meta.git clash-meta
cd clash-meta
```
### Apply patch
```
git apply patch/*.patch
```
### Build clash-meta
```
go build -o clash-meta
```
### start clash-meta:
put your config.yaml in this directory and run:
```
./clash-meta -d ./
```
### Use debug API
You can check available API on `http://127.0.0.1:xxxx/debug/pprof/`,
`xxxx` refers to the `external-controller` port in your config.yaml.
You may need to install [Graphviz](https://graphviz.org/download/) before you view the http debug API tools below:
Heap details:
```
go tool pprof -http=:8080 http://127.0.0.1:xxxx/debug/pprof/heap
````
Allocs details
````
go tool pprof -http=:8080 http://127.0.0.1:xxxx/debug/pprof/allocs
````