Skip to content

Commit

Permalink
remove pprof on client side to shrink binary size
Browse files Browse the repository at this point in the history
  • Loading branch information
xtaci committed Mar 15, 2017
1 parent 9a162e7 commit e667b74
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
1 change: 0 additions & 1 deletion client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ type Config struct {
Log string `json:"log"`
SnmpLog string `json:"snmplog"`
SnmpPeriod int `json:"snmpperiod"`
Pprof bool `json:"pprof"`
}

func parseJSONConfig(config *Config, path string) error {
Expand Down
11 changes: 0 additions & 11 deletions client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import (
"log"
"math/rand"
"net"
"net/http"
_ "net/http/pprof"
"os"
"sync"
"time"
Expand Down Expand Up @@ -238,10 +236,6 @@ func main() {
Value: 60,
Usage: "snmp collect period, in seconds",
},
cli.BoolFlag{
Name: "pprof",
Usage: "start profiling server on :6060",
},
cli.StringFlag{
Name: "log",
Value: "",
Expand Down Expand Up @@ -280,7 +274,6 @@ func main() {
config.Log = c.String("log")
config.SnmpLog = c.String("snmplog")
config.SnmpPeriod = c.Int("snmpperiod")
config.Pprof = c.Bool("pprof")

if c.String("c") != "" {
err := parseJSONConfig(&config, c.String("c"))
Expand Down Expand Up @@ -359,7 +352,6 @@ func main() {
log.Println("scavengettl:", config.ScavengeTTL)
log.Println("snmplog:", config.SnmpLog)
log.Println("snmpperiod:", config.SnmpPeriod)
log.Println("pprof:", config.Pprof)

smuxConfig := smux.DefaultConfig()
smuxConfig.MaxReceiveBuffer = config.SockBuf
Expand Down Expand Up @@ -425,9 +417,6 @@ func main() {
chScavenger := make(chan *smux.Session, 128)
go scavenger(chScavenger, config.ScavengeTTL)
go snmpLogger(config.SnmpLog, config.SnmpPeriod)
if config.Pprof {
go http.ListenAndServe(":6060", nil)
}
rr := uint16(0)
for {
p1, err := listener.AcceptTCP()
Expand Down

0 comments on commit e667b74

Please sign in to comment.