mirror of https://github.com/milvus-io/milvus.git
Expose created time and updated time to indexcoord metrics (#8591)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>pull/8212/head
parent
28aed84036
commit
0d41efe154
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue