Normalize DataNode term in DataCoord metrics_info.go (#13837)

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
pull/13894/head
congqixia 2021-12-21 19:03:20 +08:00 committed by GitHub
parent 83df76d7af
commit e1bcc0e037
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 5 deletions

View File

@ -45,11 +45,11 @@ func (s *Server) getSystemInfoMetrics(
// for each data node, fetch metrics info // for each data node, fetch metrics info
log.Debug("datacoord.getSystemInfoMetrics", log.Debug("datacoord.getSystemInfoMetrics",
zap.Int("data nodes num", len(nodes))) zap.Int("DataNodes number", len(nodes)))
for _, node := range nodes { for _, node := range nodes {
infos, err := s.getDataNodeMetrics(ctx, req, node) infos, err := s.getDataNodeMetrics(ctx, req, node)
if err != nil { if err != nil {
log.Warn("fails to get datanode metrics", zap.Error(err)) log.Warn("fails to get DataNode metrics", zap.Error(err))
continue continue
} }
clusterTopology.ConnectedNodes = append(clusterTopology.ConnectedNodes, infos) clusterTopology.ConnectedNodes = append(clusterTopology.ConnectedNodes, infos)
@ -113,8 +113,8 @@ func (s *Server) getDataCoordMetrics() metricsinfo.DataCoordInfos {
return ret return ret
} }
// getDataNodeMetrics composes data node infos // getDataNodeMetrics composes DataNode infos
// this function will invoke GetMetrics with data node specified in NodeInfo // this function will invoke GetMetrics with DataNode specified in NodeInfo
func (s *Server) getDataNodeMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest, node *Session) (metricsinfo.DataNodeInfos, error) { func (s *Server) getDataNodeMetrics(ctx context.Context, req *milvuspb.GetMetricsRequest, node *Session) (metricsinfo.DataNodeInfos, error) {
infos := metricsinfo.DataNodeInfos{ infos := metricsinfo.DataNodeInfos{
BaseComponentInfos: metricsinfo.BaseComponentInfos{ BaseComponentInfos: metricsinfo.BaseComponentInfos{
@ -151,7 +151,7 @@ func (s *Server) getDataNodeMetrics(ctx context.Context, req *milvuspb.GetMetric
err = metricsinfo.UnmarshalComponentInfos(metrics.GetResponse(), &infos) err = metricsinfo.UnmarshalComponentInfos(metrics.GetResponse(), &infos)
if err != nil { if err != nil {
log.Warn("invalid metrics of data node was found", log.Warn("invalid metrics of DataNode found",
zap.Error(err)) zap.Error(err))
infos.BaseComponentInfos.ErrorReason = err.Error() infos.BaseComponentInfos.ErrorReason = err.Error()
return infos, nil return infos, nil