Skip to content

Commit

Permalink
cmd/web: Enable pprof profiling
Browse files Browse the repository at this point in the history
First step toward diagnosing #1.
  • Loading branch information
jcrd committed Mar 16, 2021
1 parent 8a30dbd commit e3d0788
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cmd/web/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import (
"flag"
"log"
"net/http"
_ "net/http/pprof"
"runtime"
"text/template"
"time"

Expand All @@ -18,6 +20,11 @@ type Index struct {
Scale int
}

func init() {
runtime.SetBlockProfileRate(1)
runtime.SetMutexProfileFraction(1)
}

func main() {
update := flag.Duration("update", time.Second, "Delta update frequency")
addr := flag.String("addr", ":3000", "http service address")
Expand Down

0 comments on commit e3d0788

Please sign in to comment.