Expose created time and updated time to querycoord metrics (#9732)

Signed-off-by: dragondriver <jiquan.long@zilliz.com>
pull/9747/head
dragondriver 2021-10-12 19:39:24 +08:00 committed by GitHub
parent e3ce1696e7
commit 5bbffeacfd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 2 deletions

View File

@ -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.QueryCoordRole,
CreatedTime: Params.CreatedTime.String(),
UpdatedTime: Params.UpdatedTime.String(),
Type: typeutil.QueryCoordRole,
},
SystemConfigurations: metricsinfo.QueryCoordConfiguration{
SearchChannelPrefix: Params.SearchChannelPrefix,

View File

@ -16,6 +16,7 @@ import (
"strconv"
"strings"
"sync"
"time"
"github.com/milvus-io/milvus/internal/log"
"github.com/milvus-io/milvus/internal/util/paramtable"
@ -57,6 +58,9 @@ type ParamTable struct {
MinioSecretAccessKey string
MinioUseSSLStr bool
MinioBucketName string
CreatedTime time.Time
UpdatedTime time.Time
}
// Params are variables of the ParamTable type

View File

@ -135,6 +135,10 @@ func (qc *QueryCoord) Init() error {
func (qc *QueryCoord) Start() error {
qc.scheduler.Start()
log.Debug("start scheduler ...")
Params.CreatedTime = time.Now()
Params.UpdatedTime = time.Now()
qc.UpdateStateCode(internalpb.StateCode_Healthy)
qc.loopWg.Add(1)