未验证 提交 019f18dd 编写于 作者: D dragondriver 提交者: GitHub

Expose created time and updated time to datacoord metrics (#8172)

Signed-off-by: Ndragondriver <jiquan.long@zilliz.com>
上级 8b82d875
...@@ -99,8 +99,9 @@ func (s *Server) getDataCoordMetrics() metricsinfo.DataCoordInfos { ...@@ -99,8 +99,9 @@ func (s *Server) getDataCoordMetrics() metricsinfo.DataCoordInfos {
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.DataCoordRole, UpdatedTime: Params.UpdatedTime.String(),
Type: typeutil.DataCoordRole,
}, },
SystemConfigurations: metricsinfo.DataCoordConfiguration{ SystemConfigurations: metricsinfo.DataCoordConfiguration{
SegmentMaxSize: Params.SegmentMaxSize, SegmentMaxSize: Params.SegmentMaxSize,
......
...@@ -16,6 +16,7 @@ import ( ...@@ -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"
...@@ -59,6 +60,9 @@ type ParamTable struct { ...@@ -59,6 +60,9 @@ type ParamTable struct {
SegmentInfoChannelName string SegmentInfoChannelName string
DataCoordSubscriptionName string DataCoordSubscriptionName string
CreatedTime time.Time
UpdatedTime time.Time
Log log.Config Log log.Config
} }
......
...@@ -236,8 +236,13 @@ func (s *Server) Start() error { ...@@ -236,8 +236,13 @@ func (s *Server) Start() error {
if err := helper.Execute(); err != nil { if err := helper.Execute(); err != nil {
return err return err
} }
Params.CreatedTime = time.Now()
Params.UpdatedTime = time.Now()
atomic.StoreInt64(&s.isServing, ServerStateHealthy) atomic.StoreInt64(&s.isServing, ServerStateHealthy)
log.Debug("dataCoordinator startup success") log.Debug("dataCoordinator startup success")
return nil return nil
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册