mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-10 07:34:04 -08:00
Add mutex and block profiling via envvar
This commit is contained in:
parent
78205b76e9
commit
fffe51fb03
|
@ -22,6 +22,7 @@ import (
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
"time"
|
"time"
|
||||||
|
@ -64,6 +65,11 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
if os.Getenv("DEBUG") != "" {
|
||||||
|
runtime.SetBlockProfileRate(20)
|
||||||
|
runtime.SetMutexProfileFraction(20)
|
||||||
|
}
|
||||||
|
|
||||||
cfg := struct {
|
cfg := struct {
|
||||||
printVersion bool
|
printVersion bool
|
||||||
configFile string
|
configFile string
|
||||||
|
|
Loading…
Reference in a new issue