mirror of
https://gitee.com/milvus-io/milvus.git
synced 2025-12-06 17:18:35 +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",
|
log.Debug("DataNode Init",
|
||||||
zap.String("MsgChannelSubName", Params.MsgChannelSubName),
|
zap.String("MsgChannelSubName", Params.MsgChannelSubName),
|
||||||
)
|
)
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -342,6 +343,10 @@ func (node *DataNode) Start() error {
|
|||||||
FilterThreshold = rep.GetTimestamp()
|
FilterThreshold = rep.GetTimestamp()
|
||||||
|
|
||||||
go node.BackGroundGC(node.clearSignal)
|
go node.BackGroundGC(node.clearSignal)
|
||||||
|
|
||||||
|
Params.CreatedTime = time.Now()
|
||||||
|
Params.UpdatedTime = time.Now()
|
||||||
|
|
||||||
node.UpdateStateCode(internalpb.StateCode_Healthy)
|
node.UpdateStateCode(internalpb.StateCode_Healthy)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|||||||
@ -39,8 +39,9 @@ func (node *DataNode) getSystemInfoMetrics(ctx context.Context, req *milvuspb.Ge
|
|||||||
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(),
|
||||||
Type: typeutil.DataNodeRole,
|
UpdatedTime: Params.UpdatedTime.String(),
|
||||||
|
Type: typeutil.DataNodeRole,
|
||||||
},
|
},
|
||||||
SystemConfigurations: metricsinfo.DataNodeConfiguration{
|
SystemConfigurations: metricsinfo.DataNodeConfiguration{
|
||||||
FlushInsertBufferSize: Params.FlushInsertBufferSize,
|
FlushInsertBufferSize: Params.FlushInsertBufferSize,
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import (
|
|||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"sync"
|
"sync"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/milvus-io/milvus/internal/log"
|
"github.com/milvus-io/milvus/internal/log"
|
||||||
"github.com/milvus-io/milvus/internal/util/paramtable"
|
"github.com/milvus-io/milvus/internal/util/paramtable"
|
||||||
@ -62,6 +63,9 @@ type ParamTable struct {
|
|||||||
MinioSecretAccessKey string
|
MinioSecretAccessKey string
|
||||||
MinioUseSSL bool
|
MinioUseSSL bool
|
||||||
MinioBucketName string
|
MinioBucketName string
|
||||||
|
|
||||||
|
CreatedTime time.Time
|
||||||
|
UpdatedTime time.Time
|
||||||
}
|
}
|
||||||
|
|
||||||
var Params ParamTable
|
var Params ParamTable
|
||||||
|
|||||||
@ -14,6 +14,7 @@ package datanode
|
|||||||
import (
|
import (
|
||||||
"log"
|
"log"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestParamTable_DataNode(t *testing.T) {
|
func TestParamTable_DataNode(t *testing.T) {
|
||||||
@ -98,4 +99,14 @@ func TestParamTable_DataNode(t *testing.T) {
|
|||||||
name := Params.MinioBucketName
|
name := Params.MinioBucketName
|
||||||
log.Println("MinioBucketName:", name)
|
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…
x
Reference in New Issue
Block a user