mirror of https://github.com/ledisdb/ledisdb.git
remove cpu info
1, cpu info field is not cross platform 2, may use other tool to see
This commit is contained in:
parent
53ff437877
commit
947ec0081b
|
@ -9,7 +9,6 @@ import (
|
|||
"strings"
|
||||
"sync"
|
||||
"sync/atomic"
|
||||
"syscall"
|
||||
)
|
||||
|
||||
type info struct {
|
||||
|
@ -76,8 +75,6 @@ func (i *info) Dump(section string) []byte {
|
|||
i.dumpServer(buf)
|
||||
case "client":
|
||||
i.dumpClients(buf)
|
||||
case "cpu":
|
||||
i.dumpCPU(buf)
|
||||
case "mem":
|
||||
i.dumpMem(buf)
|
||||
case "persistence":
|
||||
|
@ -103,8 +100,6 @@ func (i *info) dumpAll(buf *bytes.Buffer) {
|
|||
buf.Write(Delims)
|
||||
i.dumpClients(buf)
|
||||
buf.Write(Delims)
|
||||
i.dumpCPU(buf)
|
||||
buf.Write(Delims)
|
||||
i.dumpMem(buf)
|
||||
buf.Write(Delims)
|
||||
i.dumpGoroutine(buf)
|
||||
|
@ -125,18 +120,6 @@ func (i *info) dumpClients(buf *bytes.Buffer) {
|
|||
i.dumpPairs(buf, infoPair{"client_num", i.Clients.ConnectedClients})
|
||||
}
|
||||
|
||||
func (i *info) dumpCPU(buf *bytes.Buffer) {
|
||||
buf.WriteString("# CPU\r\n")
|
||||
|
||||
var rusage syscall.Rusage
|
||||
if err := syscall.Getrusage(syscall.RUSAGE_SELF, &rusage); err != nil {
|
||||
return
|
||||
}
|
||||
|
||||
i.dumpPairs(buf, infoPair{"cpu_sys", rusage.Stime.Usec},
|
||||
infoPair{"cpu_user", rusage.Utime.Usec})
|
||||
}
|
||||
|
||||
func (i *info) dumpMem(buf *bytes.Buffer) {
|
||||
buf.WriteString("# Mem\r\n")
|
||||
|
||||
|
|
Loading…
Reference in New Issue