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() {
|
||||
startErr = i.sched.Start()
|
||||
|
||||
Params.CreatedTime = time.Now()
|
||||
Params.UpdatedTime = time.Now()
|
||||
|
||||
//start liveness check
|
||||
go i.session.LivenessCheck(i.loopCtx, i.liveCh, func() {
|
||||
i.Stop()
|
||||
|
|
|
@ -45,7 +45,8 @@ func getSystemInfoMetrics(
|
|||
SystemVersion: os.Getenv(metricsinfo.GitCommitEnvKey),
|
||||
DeployMode: os.Getenv(metricsinfo.DeployModeEnvKey),
|
||||
},
|
||||
// TODO(dragondriver): CreatedTime & UpdatedTime, easy but time-costing
|
||||
CreatedTime: Params.CreatedTime.String(),
|
||||
UpdatedTime: Params.UpdatedTime.String(),
|
||||
Type: typeutil.IndexNodeRole,
|
||||
},
|
||||
SystemConfigurations: metricsinfo.IndexNodeConfiguration{
|
||||
|
|
|
@ -17,6 +17,7 @@ import (
|
|||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"go.uber.org/zap"
|
||||
|
||||
|
@ -49,6 +50,9 @@ type ParamTable struct {
|
|||
|
||||
SimdType string
|
||||
|
||||
CreatedTime time.Time
|
||||
UpdatedTime time.Time
|
||||
|
||||
Log log.Config
|
||||
}
|
||||
|
||||
|
|
|
@ -13,6 +13,7 @@ package indexnode
|
|||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
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`
|
||||
|
||||
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.
|
||||
|
|
Loading…
Reference in New Issue