mirror of https://github.com/milvus-io/milvus.git
Expose created time and updated time to indexnode metrics (#8592)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>pull/8212/head
parent
0d41efe154
commit
68b9da219a
|
@ -167,6 +167,9 @@ func (i *IndexNode) Start() error {
|
||||||
i.once.Do(func() {
|
i.once.Do(func() {
|
||||||
startErr = i.sched.Start()
|
startErr = i.sched.Start()
|
||||||
|
|
||||||
|
Params.CreatedTime = time.Now()
|
||||||
|
Params.UpdatedTime = time.Now()
|
||||||
|
|
||||||
//start liveness check
|
//start liveness check
|
||||||
go i.session.LivenessCheck(i.loopCtx, i.liveCh, func() {
|
go i.session.LivenessCheck(i.loopCtx, i.liveCh, func() {
|
||||||
i.Stop()
|
i.Stop()
|
||||||
|
|
|
@ -45,7 +45,8 @@ func getSystemInfoMetrics(
|
||||||
SystemVersion: os.Getenv(metricsinfo.GitCommitEnvKey),
|
SystemVersion: os.Getenv(metricsinfo.GitCommitEnvKey),
|
||||||
DeployMode: os.Getenv(metricsinfo.DeployModeEnvKey),
|
DeployMode: os.Getenv(metricsinfo.DeployModeEnvKey),
|
||||||
},
|
},
|
||||||
// TODO(dragondriver): CreatedTime & UpdatedTime, easy but time-costing
|
CreatedTime: Params.CreatedTime.String(),
|
||||||
|
UpdatedTime: Params.UpdatedTime.String(),
|
||||||
Type: typeutil.IndexNodeRole,
|
Type: typeutil.IndexNodeRole,
|
||||||
},
|
},
|
||||||
SystemConfigurations: metricsinfo.IndexNodeConfiguration{
|
SystemConfigurations: metricsinfo.IndexNodeConfiguration{
|
||||||
|
|
|
@ -17,6 +17,7 @@ import (
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"go.uber.org/zap"
|
"go.uber.org/zap"
|
||||||
|
|
||||||
|
@ -49,6 +50,9 @@ type ParamTable struct {
|
||||||
|
|
||||||
SimdType string
|
SimdType string
|
||||||
|
|
||||||
|
CreatedTime time.Time
|
||||||
|
UpdatedTime time.Time
|
||||||
|
|
||||||
Log log.Config
|
Log log.Config
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ package indexnode
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParamTable(t *testing.T) {
|
func TestParamTable(t *testing.T) {
|
||||||
|
@ -71,6 +72,16 @@ func TestParamTable(t *testing.T) {
|
||||||
})
|
})
|
||||||
|
|
||||||
// FIXME(dragondriver): how to cover panic case? we use `LoadWithDefault` to initialize `SimdType`
|
// FIXME(dragondriver): how to cover panic case? we use `LoadWithDefault` to initialize `SimdType`
|
||||||
|
|
||||||
|
t.Run("CreatedTime", func(t *testing.T) {
|
||||||
|
Params.CreatedTime = time.Now()
|
||||||
|
t.Logf("CreatedTime: %v", Params.CreatedTime)
|
||||||
|
})
|
||||||
|
|
||||||
|
t.Run("UpdatedTime", func(t *testing.T) {
|
||||||
|
Params.UpdatedTime = time.Now()
|
||||||
|
t.Logf("UpdatedTime: %v", Params.UpdatedTime)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Params Load should be return error when key does not exist.
|
//TODO: Params Load should be return error when key does not exist.
|
||||||
|
|
Loading…
Reference in New Issue