Skip to content

Commit

Permalink
pprof now will not require debug build flag
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeuw committed Jul 25, 2019
1 parent f9c5ce8 commit 0695f9d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 33 deletions.
5 changes: 0 additions & 5 deletions Makefile
Expand Up @@ -16,11 +16,6 @@ server:
go build -ldflags "-X main.version=${version}" ./cmd/ck-server
mv ck-server* ./build

server_pprof:
mkdir -p build
go build -ldflags "-X main.version=${version}" -tags pprof ./cmd/ck-server
mv ck-server* ./build

install:
mv build/ck-* /usr/local/bin

Expand Down
8 changes: 7 additions & 1 deletion cmd/ck-server/ck-server.go
Expand Up @@ -10,6 +10,7 @@ import (
"net"
"net/http"
"os"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -244,7 +245,12 @@ func main() {
}

if *pprofAddr != "" {
startPprof(*pprofAddr)
runtime.SetBlockProfileRate(5)
go func() {
log.Println(http.ListenAndServe(*pprofAddr, nil))
}()
log.Println("pprof listening on " + *pprofAddr)

}

log.Printf("Starting standalone mode, listening on %v:%v", bindHost, bindPort)
Expand Down
9 changes: 0 additions & 9 deletions cmd/ck-server/pprof.go

This file was deleted.

18 changes: 0 additions & 18 deletions cmd/ck-server/pprof_debug.go

This file was deleted.

0 comments on commit 0695f9d

Please sign in to comment.