Skip to content

Latest commit

 

History

History
53 lines (39 loc) · 1.5 KB

File metadata and controls

53 lines (39 loc) · 1.5 KB

pprofs

Auto capture profiles.

Build Status codecov Go Report Card GitHub go.mod Go version GitHub tag (latest by date)

Quick start

package main

import "github.com/gochore/pprofs"

func main() {
	if err := pprofs.EnableCapture(); err != nil {
		panic(err)
	}
	// ...
}

It will auto capture profiles and store files in temp dir.

You can specify the dir and the ttl of files by environment variables:

export PPROF_DIR="~/somewhere"
export PPROF_TTL="1h"

Or use options:

func main() {
	if err := pprofs.EnableCapture(
		pprofs.WithStorage(pprofs.NewFileStorage("prefix", "~/somewhere", time.Hour)),
	); err != nil {
		panic(err)
	}
	// ...
}

See more examples.

Reference