Skip to content

Commit

Permalink
rename vitals to stats
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyll committed Jan 3, 2017
1 parent 664fdf9 commit 0e47ba9
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ gops reports the Go version the target program is built with, if you run the fol
$ gops version <pid>
```

#### 6. vitals
#### 6. stats

To print the runtime statistics such as number of goroutines and `GOMAXPROCS`, run the following:

```sh
$ gops vitals <pid>
$ gops stats <pid>
```
2 changes: 1 addition & 1 deletion agent/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
6 changes: 3 additions & 3 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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".
Expand Down
4 changes: 2 additions & 2 deletions signal/signal.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
)

0 comments on commit 0e47ba9

Please sign in to comment.