Skip to content

gochore/pprofs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

7364078 · Mar 7, 2022

History

20 Commits
Jan 3, 2022
Dec 30, 2021
Dec 30, 2021
Dec 30, 2021
Jan 4, 2022
Jan 4, 2022
Jan 3, 2022
Jan 3, 2022
Jan 4, 2022
Jan 4, 2022
Jan 4, 2022
Jan 4, 2022
Jan 4, 2022
Mar 7, 2022
Jan 4, 2022

Repository files navigation

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