mirror of
https://github.com/DataDog/go-profiler-notes.git
synced 2026-06-20 16:45:26 +08:00
small tweaks
This commit is contained in:
parent
bbef4f210c
commit
f0ad919665
2 changed files with 9 additions and 0 deletions
|
|
@ -1,6 +1,7 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"runtime"
|
||||
|
|
@ -18,6 +19,10 @@ func main() {
|
|||
}
|
||||
|
||||
func run() error {
|
||||
labels := pprof.Labels("test_label", "test_value")
|
||||
ctx := pprof.WithLabels(context.Background(), labels)
|
||||
pprof.SetGoroutineLabels(ctx)
|
||||
|
||||
runtime.SetBlockProfileRate(int((40 * time.Microsecond).Nanoseconds()))
|
||||
done := make(chan struct{})
|
||||
g := errgroup.Group{}
|
||||
|
|
|
|||
4
heap.md
4
heap.md
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
Totally a work in progress ... !!! Please come back later : ).
|
||||
|
||||
https://twitter.com/felixge/status/1355846360562589696
|
||||
|
||||
|
||||
|
||||
## How does it work?
|
||||
|
||||
Look at the go source code to understand how the data is captured, what role runtime.MemProfileRate plays, etc.
|
||||
|
|
|
|||
Loading…
Reference in a new issue