From 97c7f1493e82826527dfa7ff070494dc349eb80c Mon Sep 17 00:00:00 2001 From: Larvan2 <78135608+Larvan2@users.noreply.github.com> Date: Mon, 30 Jan 2023 20:36:43 +0800 Subject: [PATCH] Created How to use debug api (markdown) --- How-to-use-debug-api.md | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 How-to-use-debug-api.md diff --git a/How-to-use-debug-api.md b/How-to-use-debug-api.md new file mode 100644 index 0000000..f458931 --- /dev/null +++ b/How-to-use-debug-api.md @@ -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 +````