pull/21138/head
absolutelightning 3 months ago
parent a6a39d3212
commit 05eeba87aa

@ -5,13 +5,10 @@ package main
import (
"fmt"
mcli "github.com/mitchellh/cli"
"io"
"log"
"os"
"runtime"
"time"
mcli "github.com/mitchellh/cli"
"github.com/hashicorp/consul/command"
"github.com/hashicorp/consul/command/cli"
@ -19,21 +16,7 @@ import (
_ "github.com/hashicorp/consul/service_os"
)
func printMemStats() {
var memStats runtime.MemStats
runtime.ReadMemStats(&memStats)
fmt.Printf("Alloc = %v MiB", memStats.Alloc/1024/1024)
fmt.Printf("\tTotalAlloc = %v MiB", memStats.TotalAlloc/1024/1024)
fmt.Printf("\tSys = %v MiB", memStats.Sys/1024/1024)
fmt.Printf("\tNumGC = %v\n", memStats.NumGC)
time.Sleep(2 * time.Second)
printMemStats()
}
func main() {
go func() {
printMemStats()
}()
os.Exit(realMain())
}

Loading…
Cancel
Save