mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-01 19:39:21 +08:00
[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:
parent
b41db3a4ca
commit
bff7af3e2e
@ -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')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user