MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / getMemoryHuman

Function getMemoryHuman

server_info.go:51–61  ·  view source on GitHub ↗
(m uint64)

Source from the content-addressed store, hash-verified

49}
50
51func getMemoryHuman(m uint64) string {
52 if m > GB {
53 return fmt.Sprintf("%0.3fG", float64(m)/float64(GB))
54 } else if m > MB {
55 return fmt.Sprintf("%0.3fM", float64(m)/float64(MB))
56 } else if m > KB {
57 return fmt.Sprintf("%0.3fK", float64(m)/float64(KB))
58 } else {
59 return fmt.Sprintf("%d", m)
60 }
61}
62
63func (i *info) Dump(section string) []byte {
64 buf := &bytes.Buffer{}

Callers 1

dumpMemMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected