[skip ci]Implement getting milvus build and deploy mode in metrics (#8182)

Signed-off-by: yanliang567 <yanliang.qiao@zilliz.com>
This commit is contained in:
yanliang567 2021-09-18 10:41:50 +08:00 committed by GitHub
parent b41db3a4ca
commit bff7af3e2e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,5 @@
import ujson
import json
from pymilvus.grpc_gen import milvus_pb2 as milvus_types
from pymilvus import connections
@ -22,18 +23,22 @@ class MilvusSys:
req = milvus_types.GetMetricsRequest(request=sys_logs_req)
self.sys_logs = handler._stub.GetMetrics(req, wait_for_ready=True, timeout=None)
@property
def build_version(self):
raise NotImplementedError()
return self.nodes[0].get('infos').get('system_info').get('system_version')
@property
def deploy_mode(self):
raise NotImplementedError()
return self.nodes[0].get('infos').get('system_info').get('deploy_mode')
@property
def simd_type(self):
raise NotImplementedError()
# TODO: get simd_type when milvus metrics implemented
# for node in self.nodes:
# if 'QueryNode' == node.get('infos').get('type'):
# return node.get('infos').get('simd_type')
# raise Exception("No query node found")
@property
def query_nodes(self):
@ -47,3 +52,7 @@ class MilvusSys:
def index_nodes(self):
raise NotImplementedError()
@property
def nodes(self):
return json.loads(self.sys_info.response).get('nodes_info')