未验证 提交 0d41efe1 编写于 作者: D dragondriver 提交者: GitHub

Expose created time and updated time to indexcoord metrics (#8591)

Signed-off-by: Ndragondriver <jiquan.long@zilliz.com>
上级 28aed840
......@@ -250,6 +250,9 @@ func (i *IndexCoord) Start() error {
cb()
}
Params.CreatedTime = time.Now()
Params.UpdatedTime = time.Now()
i.UpdateStateCode(internalpb.StateCode_Healthy)
log.Debug("IndexCoord start successfully", zap.Any("State", i.stateCode.Load()))
......
......@@ -50,8 +50,9 @@ func getSystemInfoMetrics(
SystemVersion: os.Getenv(metricsinfo.GitCommitEnvKey),
DeployMode: os.Getenv(metricsinfo.DeployModeEnvKey),
},
// TODO(dragondriver): CreatedTime & UpdatedTime, easy but time-costing
Type: typeutil.IndexCoordRole,
CreatedTime: Params.CreatedTime.String(),
UpdatedTime: Params.UpdatedTime.String(),
Type: typeutil.IndexCoordRole,
},
SystemConfigurations: metricsinfo.IndexCoordConfiguration{
MinioBucketName: Params.MinioBucketName,
......
......@@ -16,6 +16,7 @@ import (
"strconv"
"strings"
"sync"
"time"
"github.com/milvus-io/milvus/internal/log"
"github.com/milvus-io/milvus/internal/util/paramtable"
......@@ -37,6 +38,9 @@ type ParamTable struct {
MinIOUseSSL bool
MinioBucketName string
CreatedTime time.Time
UpdatedTime time.Time
Log log.Config
}
......
......@@ -13,6 +13,7 @@ package indexcoord
import (
"testing"
"time"
)
func TestParamTable(t *testing.T) {
......@@ -57,6 +58,16 @@ func TestParamTable(t *testing.T) {
t.Run("MinioBucketName", func(t *testing.T) {
t.Logf("MinioBucketName: %v", Params.MinioBucketName)
})
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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册