From 0e47ba961c6854dba59ae5cb22fc42cafd3d4cc6 Mon Sep 17 00:00:00 2001 From: Jaana Burcu Dogan Date: Tue, 3 Jan 2017 01:15:13 -0800 Subject: [PATCH] rename vitals to stats --- README.md | 4 ++-- agent/agent.go | 2 +- cmd.go | 6 +++--- main.go | 2 +- signal/signal.go | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d6db5999..b7687842 100644 --- a/README.md +++ b/README.md @@ -108,10 +108,10 @@ gops reports the Go version the target program is built with, if you run the fol $ gops version ``` -#### 6. vitals +#### 6. stats To print the runtime statistics such as number of goroutines and `GOMAXPROCS`, run the following: ```sh -$ gops vitals +$ gops stats ``` diff --git a/agent/agent.go b/agent/agent.go index 026ff5ff..398aea92 100644 --- a/agent/agent.go +++ b/agent/agent.go @@ -187,7 +187,7 @@ func handle(conn net.Conn, msg []byte) error { } time.Sleep(30 * time.Second) pprof.StopCPUProfile() - case signal.Vitals: + case signal.Stats: fmt.Fprintf(conn, "goroutines: %v\n", runtime.NumGoroutine()) fmt.Fprintf(conn, "OS threads: %v\n", pprof.Lookup("threadcreate").Count()) fmt.Fprintf(conn, "GOMAXPROCS: %v\n", runtime.GOMAXPROCS(0)) diff --git a/cmd.go b/cmd.go index bf618585..60673a20 100644 --- a/cmd.go +++ b/cmd.go @@ -20,7 +20,7 @@ var cmds = map[string](func(pid int) error){ "version": version, "pprof-heap": pprofHeap, "pprof-cpu": pprofCPU, - "vitals": vitals, + "stats": stats, } func stackTrace(pid int) error { @@ -82,8 +82,8 @@ func pprof(pid int, p byte) error { return cmd.Run() } -func vitals(pid int) error { - return cmdWithPrint(pid, signal.Vitals) +func stats(pid int) error { + return cmdWithPrint(pid, signal.Stats) } func cmdWithPrint(pid int, c byte) error { diff --git a/main.go b/main.go index 7b3c7b98..d869884d 100644 --- a/main.go +++ b/main.go @@ -28,7 +28,7 @@ Commands: stack Prints the stack trace. memstats Prints the garbage collection stats. version Prints the Go version used to build the program. - vitals Prints the runtime stats. + stats Prints the vital runtime stats. pprof-heap Reads the heap profile and launches "go tool pprof". pprof-cpu Reads the CPU profile and launches "go tool pprof". diff --git a/signal/signal.go b/signal/signal.go index b440219d..aefeaa69 100644 --- a/signal/signal.go +++ b/signal/signal.go @@ -24,6 +24,6 @@ const ( // CPUProfile starts `go tool pprof` with the current CPU profile CPUProfile = byte(0x6) - // Vitals returns Go runtime statistics such as number of goroutines, GOMAXPROCS, and NumCPU. - Vitals = byte(0x7) + // Stats returns Go runtime statistics such as number of goroutines, GOMAXPROCS, and NumCPU. + Stats = byte(0x7) )