mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-11-29 18:38:44 +08:00
enhance: print total memory when milvus starts (#29351)
fix: #29349 --------- Signed-off-by: longjiquan <jiquan.long@zilliz.com>
This commit is contained in:
parent
4b3de64733
commit
a3bae80b59
@ -11,6 +11,7 @@ import (
|
|||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
"github.com/milvus-io/milvus/pkg/log"
|
"github.com/milvus-io/milvus/pkg/log"
|
||||||
|
"github.com/milvus-io/milvus/pkg/util/hardware"
|
||||||
"github.com/milvus-io/milvus/pkg/util/metricsinfo"
|
"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.printBanner(flags.Output())
|
||||||
c.injectVariablesToEnv()
|
c.injectVariablesToEnv()
|
||||||
|
c.printHardwareInfo(flags.Output())
|
||||||
lock, err := createPidFile(flags.Output(), filename, runtimeDir)
|
lock, err := createPidFile(flags.Output(), filename, runtimeDir)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
@ -59,6 +61,14 @@ func (c *run) printBanner(w io.Writer) {
|
|||||||
fmt.Fprintln(w)
|
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() {
|
func (c *run) injectVariablesToEnv() {
|
||||||
// inject in need
|
// inject in need
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user