Expose created time and updated time to querynode metrics (#9738)

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

View File

@ -44,8 +44,9 @@ func getSystemInfoMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest,
SystemVersion: os.Getenv(metricsinfo.GitCommitEnvKey),
DeployMode: os.Getenv(metricsinfo.DeployModeEnvKey),
},
// TODO(dragondriver): CreatedTime & UpdatedTime, easy but time-costing
Type: typeutil.QueryNodeRole,
CreatedTime: Params.CreatedTime.String(),
UpdatedTime: Params.UpdatedTime.String(),
Type: typeutil.QueryNodeRole,
},
SystemConfigurations: metricsinfo.QueryNodeConfiguration{
SearchReceiveBufSize: Params.SearchReceiveBufSize,

View File

@ -16,6 +16,7 @@ import (
"strconv"
"strings"
"sync"
"time"
"go.uber.org/zap"
@ -76,6 +77,9 @@ type ParamTable struct {
// segcore
ChunkRows int64
SimdType string
CreatedTime time.Time
UpdatedTime time.Time
}
var Params ParamTable

View File

@ -30,6 +30,7 @@ import (
"strconv"
"sync"
"sync/atomic"
"time"
"unsafe"
"go.uber.org/zap"
@ -214,6 +215,9 @@ func (node *QueryNode) Start() error {
node.Stop()
})
Params.CreatedTime = time.Now()
Params.UpdatedTime = time.Now()
node.UpdateStateCode(internalpb.StateCode_Healthy)
return nil
}