Show memory usage on the version page
This commit is contained in:
14
meta/meta.go
Normal file
14
meta/meta.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package meta
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"runtime"
|
||||
)
|
||||
|
||||
func MemInfo() string {
|
||||
stats := runtime.MemStats{}
|
||||
runtime.ReadMemStats(&stats)
|
||||
|
||||
return fmt.Sprintf("%.3fMb", float64(stats.Alloc)/1024.0/1024.0)
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user