From f3454ca31626be1914ce88488807094dac9ddc3b Mon Sep 17 00:00:00 2001 From: Clement Date: Fri, 6 Sep 2024 08:08:40 +0800 Subject: [PATCH] chore: README --- .github/workflows/build.yml | 6 ++++++ .github/workflows/test-go.yml | 2 ++ README.md | 30 +++++++++++++++++++++++++++++- 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e3d447a..34d2333 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,8 +3,14 @@ name: Build binary on: push: branches: [ "main" ] + paths: + - '**' + - '!README.md' pull_request: branches: [ "main" ] + paths: + - '**' + - '!README.md' workflow_dispatch: jobs: diff --git a/.github/workflows/test-go.yml b/.github/workflows/test-go.yml index 4a34134..a7853ec 100644 --- a/.github/workflows/test-go.yml +++ b/.github/workflows/test-go.yml @@ -6,11 +6,13 @@ on: paths: - '**' - '!ts/**' + - '!README.md' pull_request: branches: [ "main" ] paths: - '**' - '!ts/**' + - '!README.md' workflow_dispatch: jobs: diff --git a/README.md b/README.md index 36a3b62..8bfbba9 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,38 @@ +Xnip2024-09-05_22-25-31 + You don’t want to clutter up your computer with Docker, Prometheus, Grafana or even K8S just to monitor a Go app's heap size in real-time, right? Use `live-pprof` to Monitor a Go app's performance. It launches in just 1 second. Boost your local development now. ## Install + ```bash go install github.com/moderato-app/live-pprof ``` -Xnip2024-09-05_22-25-31 +## Usage + +1. Setup pprof endpoints + +```bash +package main + +import ( + "log" + "net/http" + _ "net/http/pprof" +) + +func main() { + log.Println(http.ListenAndServe("localhost:6060", nil)) +} +``` + +2. Monitor the pprof endpoints + +```bash +live-pprof 6060 +# Or use: +live-pprof http://localhost:6060/debug/pprof +# Both options will monitor http://localhost:6060/debug/pprof +``` \ No newline at end of file