diff --git a/cmd/milvus/run.go b/cmd/milvus/run.go index bbb19eb88ab7a..17f8e55ce2b35 100644 --- a/cmd/milvus/run.go +++ b/cmd/milvus/run.go @@ -11,6 +11,7 @@ import ( "go.uber.org/zap" "github.com/milvus-io/milvus/pkg/log" + "github.com/milvus-io/milvus/pkg/util/hardware" "github.com/milvus-io/milvus/pkg/util/metricsinfo" ) @@ -36,6 +37,7 @@ func (c *run) execute(args []string, flags *flag.FlagSet) { c.printBanner(flags.Output()) c.injectVariablesToEnv() + c.printHardwareInfo(flags.Output()) lock, err := createPidFile(flags.Output(), filename, runtimeDir) if err != nil { panic(err) @@ -59,6 +61,14 @@ func (c *run) printBanner(w io.Writer) { fmt.Fprintln(w) } +func (c *run) printHardwareInfo(w io.Writer) { + totalMem := hardware.GetMemoryCount() + usedMem := hardware.GetUsedMemoryCount() + fmt.Fprintf(w, "TotalMem: %d\n", totalMem) + fmt.Fprintf(w, "UsedMem: %d\n", usedMem) + fmt.Fprintln(w) +} + func (c *run) injectVariablesToEnv() { // inject in need