mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-02 20:09:57 +08:00
Expose created time and updated time to datanode metrics (#8173)
Signed-off-by: dragondriver <jiquan.long@zilliz.com>
This commit is contained in:
parent
57e46c5f2c
commit
daf001f683
@ -159,6 +159,7 @@ func (node *DataNode) Register() error {
|
||||
log.Debug("DataNode Init",
|
||||
zap.String("MsgChannelSubName", Params.MsgChannelSubName),
|
||||
)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@ -342,6 +343,10 @@ func (node *DataNode) Start() error {
|
||||
FilterThreshold = rep.GetTimestamp()
|
||||
|
||||
go node.BackGroundGC(node.clearSignal)
|
||||
|
||||
Params.CreatedTime = time.Now()
|
||||
Params.UpdatedTime = time.Now()
|
||||
|
||||
node.UpdateStateCode(internalpb.StateCode_Healthy)
|
||||
return nil
|
||||
}
|
||||
|
@ -39,8 +39,9 @@ func (node *DataNode) getSystemInfoMetrics(ctx context.Context, req *milvuspb.Ge
|
||||
SystemVersion: os.Getenv(metricsinfo.GitCommitEnvKey),
|
||||
DeployMode: os.Getenv(metricsinfo.DeployModeEnvKey),
|
||||
},
|
||||
// TODO(dragondriver): CreatedTime & UpdatedTime, easy but time-costing
|
||||
Type: typeutil.DataNodeRole,
|
||||
CreatedTime: Params.CreatedTime.String(),
|
||||
UpdatedTime: Params.UpdatedTime.String(),
|
||||
Type: typeutil.DataNodeRole,
|
||||
},
|
||||
SystemConfigurations: metricsinfo.DataNodeConfiguration{
|
||||
FlushInsertBufferSize: Params.FlushInsertBufferSize,
|
||||
|
@ -16,6 +16,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
|
||||
"github.com/milvus-io/milvus/internal/log"
|
||||
"github.com/milvus-io/milvus/internal/util/paramtable"
|
||||
@ -62,6 +63,9 @@ type ParamTable struct {
|
||||
MinioSecretAccessKey string
|
||||
MinioUseSSL bool
|
||||
MinioBucketName string
|
||||
|
||||
CreatedTime time.Time
|
||||
UpdatedTime time.Time
|
||||
}
|
||||
|
||||
var Params ParamTable
|
||||
|
@ -14,6 +14,7 @@ package datanode
|
||||
import (
|
||||
"log"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
func TestParamTable_DataNode(t *testing.T) {
|
||||
@ -98,4 +99,14 @@ func TestParamTable_DataNode(t *testing.T) {
|
||||
name := Params.MinioBucketName
|
||||
log.Println("MinioBucketName:", name)
|
||||
})
|
||||
|
||||
t.Run("Test CreatedTime", func(t *testing.T) {
|
||||
Params.CreatedTime = time.Now()
|
||||
log.Println("CreatedTime: ", Params.CreatedTime)
|
||||
})
|
||||
|
||||
t.Run("Test UpdatedTime", func(t *testing.T) {
|
||||
Params.UpdatedTime = time.Now()
|
||||
log.Println("UpdatedTime: ", Params.UpdatedTime)
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user