mirror of
https://gitee.com/milvus-io/milvus.git
synced 2024-12-04 04:49:08 +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 ujson
|
||||||
|
import json
|
||||||
from pymilvus.grpc_gen import milvus_pb2 as milvus_types
|
from pymilvus.grpc_gen import milvus_pb2 as milvus_types
|
||||||
from pymilvus import connections
|
from pymilvus import connections
|
||||||
|
|
||||||
@ -22,18 +23,22 @@ class MilvusSys:
|
|||||||
req = milvus_types.GetMetricsRequest(request=sys_logs_req)
|
req = milvus_types.GetMetricsRequest(request=sys_logs_req)
|
||||||
self.sys_logs = handler._stub.GetMetrics(req, wait_for_ready=True, timeout=None)
|
self.sys_logs = handler._stub.GetMetrics(req, wait_for_ready=True, timeout=None)
|
||||||
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def build_version(self):
|
def build_version(self):
|
||||||
raise NotImplementedError()
|
return self.nodes[0].get('infos').get('system_info').get('system_version')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def deploy_mode(self):
|
def deploy_mode(self):
|
||||||
raise NotImplementedError()
|
return self.nodes[0].get('infos').get('system_info').get('deploy_mode')
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def simd_type(self):
|
def simd_type(self):
|
||||||
raise NotImplementedError()
|
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
|
@property
|
||||||
def query_nodes(self):
|
def query_nodes(self):
|
||||||
@ -47,3 +52,7 @@ class MilvusSys:
|
|||||||
def index_nodes(self):
|
def index_nodes(self):
|
||||||
raise NotImplementedError()
|
raise NotImplementedError()
|
||||||
|
|
||||||
|
@property
|
||||||
|
def nodes(self):
|
||||||
|
return json.loads(self.sys_info.response).get('nodes_info')
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user