-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b042c2
commit e608ff1
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,38 @@ | ||
<img width="1920" alt="Xnip2024-09-05_22-25-31" src="https://github.com/user-attachments/assets/fee917b2-8bc6-47e5-8b18-47bd56c545a5"> | ||
|
||
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 | ||
``` | ||
|
||
<img width="1920" alt="Xnip2024-09-05_22-25-31" src="https://github.com/user-attachments/assets/fee917b2-8bc6-47e5-8b18-47bd56c545a5"> | ||
## 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 | ||
``` |