Loading src/monitoring/context_pb2.py +146 −133 File changed.Preview size limit exceeded, changes collapsed. Show changes src/monitoring/context_pb2_grpc.py +30 −51 Original line number Diff line number Diff line # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class ContextServiceStub(object): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Loading @@ -17,16 +16,18 @@ class ContextServiceStub(object): """ self.GetTopology = channel.unary_unary( '/context.ContextService/GetTopology', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, request_serializer=context__pb2.Empty.SerializeToString, response_deserializer=context__pb2.Topology.FromString, ) class ContextServiceServicer(object): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass def GetTopology(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') Loading @@ -36,32 +37,10 @@ def add_ContextServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'GetTopology': grpc.unary_unary_rpc_method_handler( servicer.GetTopology, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, request_deserializer=context__pb2.Empty.FromString, response_serializer=context__pb2.Topology.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'context.ContextService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class ContextService(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetTopology(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/context.ContextService/GetTopology', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, context__pb2.Topology.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) src/monitoring/monitoring_pb2.py +54 −67 Original line number Diff line number Diff line # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: monitoring.proto """Generated protocol buffer code.""" import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection Loading @@ -11,7 +12,6 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 Loading @@ -20,10 +20,9 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='monitoring', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\x1bgoogle/protobuf/empty.proto\x1a\rcontext.proto\"|\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x16\n\x0ekpiDescription\x18\x03 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"T\n\tKpiDevice\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"+\n\x07KpiList\x12 \n\x07kpiList\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi\"M\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x13\n\tstringVal\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value2\xfb\x01\n\x11MonitoringService\x12\x37\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\nMonitorKpi\x12\x15.monitoring.KpiDevice\x1a\x16.google.protobuf.Empty\"\x00\x12\x37\n\rGetStream_kpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3' serialized_pb=_b('\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\"|\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x16\n\x0ekpiDescription\x18\x03 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"T\n\tKpiDevice\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"+\n\x07KpiList\x12 \n\x07kpiList\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi\"M\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x13\n\tstringVal\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value2\xeb\x01\n\x11MonitoringService\x12/\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x0e.context.Empty\"\x00\x12\x35\n\nMonitorKpi\x12\x15.monitoring.KpiDevice\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetStream_kpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3') , dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,context__pb2.DESCRIPTOR,]) dependencies=[context__pb2.DESCRIPTOR,]) Loading @@ -34,7 +33,6 @@ _KPI = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpi_id', full_name='monitoring.Kpi.kpi_id', index=0, Loading @@ -42,28 +40,28 @@ _KPI = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='monitoring.Kpi.timestamp', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kpiDescription', full_name='monitoring.Kpi.kpiDescription', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kpi_value', full_name='monitoring.Kpi.kpi_value', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -76,8 +74,8 @@ _KPI = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], serialized_start=76, serialized_end=200, serialized_start=47, serialized_end=171, ) Loading @@ -87,7 +85,6 @@ _KPIID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpi_id', full_name='monitoring.KpiId.kpi_id', index=0, Loading @@ -95,7 +92,7 @@ _KPIID = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -108,8 +105,8 @@ _KPIID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], serialized_start=202, serialized_end=240, serialized_start=173, serialized_end=211, ) Loading @@ -119,7 +116,6 @@ _KPIDEVICE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpi_id', full_name='monitoring.KpiDevice.kpi_id', index=0, Loading @@ -127,14 +123,14 @@ _KPIDEVICE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='monitoring.KpiDevice.device_id', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -147,8 +143,8 @@ _KPIDEVICE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], serialized_start=242, serialized_end=326, serialized_start=213, serialized_end=297, ) Loading @@ -158,7 +154,6 @@ _KPILIST = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpiList', full_name='monitoring.KpiList.kpiList', index=0, Loading @@ -166,7 +161,7 @@ _KPILIST = _descriptor.Descriptor( has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -179,8 +174,8 @@ _KPILIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], serialized_start=328, serialized_end=371, serialized_start=299, serialized_end=342, ) Loading @@ -190,7 +185,6 @@ _KPIVALUE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='intVal', full_name='monitoring.KpiValue.intVal', index=0, Loading @@ -198,21 +192,21 @@ _KPIVALUE = _descriptor.Descriptor( has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='stringVal', full_name='monitoring.KpiValue.stringVal', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='boolVal', full_name='monitoring.KpiValue.boolVal', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -226,12 +220,10 @@ _KPIVALUE = _descriptor.Descriptor( oneofs=[ _descriptor.OneofDescriptor( name='value', full_name='monitoring.KpiValue.value', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), index=0, containing_type=None, fields=[]), ], serialized_start=373, serialized_end=450, serialized_start=344, serialized_end=421, ) _KPI.fields_by_name['kpi_id'].message_type = _KPIID Loading @@ -256,39 +248,39 @@ DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE _sym_db.RegisterFileDescriptor(DESCRIPTOR) Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), { 'DESCRIPTOR' : _KPI, '__module__' : 'monitoring_pb2' Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), dict( DESCRIPTOR = _KPI, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.Kpi) }) )) _sym_db.RegisterMessage(Kpi) KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), { 'DESCRIPTOR' : _KPIID, '__module__' : 'monitoring_pb2' KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), dict( DESCRIPTOR = _KPIID, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiId) }) )) _sym_db.RegisterMessage(KpiId) KpiDevice = _reflection.GeneratedProtocolMessageType('KpiDevice', (_message.Message,), { 'DESCRIPTOR' : _KPIDEVICE, '__module__' : 'monitoring_pb2' KpiDevice = _reflection.GeneratedProtocolMessageType('KpiDevice', (_message.Message,), dict( DESCRIPTOR = _KPIDEVICE, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiDevice) }) )) _sym_db.RegisterMessage(KpiDevice) KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), { 'DESCRIPTOR' : _KPILIST, '__module__' : 'monitoring_pb2' KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), dict( DESCRIPTOR = _KPILIST, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiList) }) )) _sym_db.RegisterMessage(KpiList) KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), { 'DESCRIPTOR' : _KPIVALUE, '__module__' : 'monitoring_pb2' KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), dict( DESCRIPTOR = _KPIVALUE, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiValue) }) )) _sym_db.RegisterMessage(KpiValue) Loading @@ -299,9 +291,8 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=453, serialized_end=704, serialized_start=424, serialized_end=659, methods=[ _descriptor.MethodDescriptor( name='IncludeKpi', Loading @@ -309,9 +300,8 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( index=0, containing_service=None, input_type=_KPI, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, output_type=context__pb2._EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='MonitorKpi', Loading @@ -319,9 +309,8 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( index=1, containing_service=None, input_type=_KPIDEVICE, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, output_type=context__pb2._EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetStream_kpi', Loading @@ -331,7 +320,6 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIID, output_type=_KPI, serialized_options=None, create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetInstantKpi', Loading @@ -341,7 +329,6 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIID, output_type=_KPI, serialized_options=None, create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE) Loading src/monitoring/monitoring_pb2_grpc.py +85 −153 Original line number Diff line number Diff line # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 import monitoring_pb2 as monitoring__pb2 class MonitoringServiceStub(object): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Loading @@ -18,12 +18,12 @@ class MonitoringServiceStub(object): self.IncludeKpi = channel.unary_unary( '/monitoring.MonitoringService/IncludeKpi', request_serializer=monitoring__pb2.Kpi.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, response_deserializer=context__pb2.Empty.FromString, ) self.MonitorKpi = channel.unary_unary( '/monitoring.MonitoringService/MonitorKpi', request_serializer=monitoring__pb2.KpiDevice.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, response_deserializer=context__pb2.Empty.FromString, ) self.GetStream_kpi = channel.unary_stream( '/monitoring.MonitoringService/GetStream_kpi', Loading @@ -38,28 +38,33 @@ class MonitoringServiceStub(object): class MonitoringServiceServicer(object): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass def IncludeKpi(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MonitorKpi(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetStream_kpi(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetInstantKpi(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') Loading @@ -70,12 +75,12 @@ def add_MonitoringServiceServicer_to_server(servicer, server): 'IncludeKpi': grpc.unary_unary_rpc_method_handler( servicer.IncludeKpi, request_deserializer=monitoring__pb2.Kpi.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_serializer=context__pb2.Empty.SerializeToString, ), 'MonitorKpi': grpc.unary_unary_rpc_method_handler( servicer.MonitorKpi, request_deserializer=monitoring__pb2.KpiDevice.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_serializer=context__pb2.Empty.SerializeToString, ), 'GetStream_kpi': grpc.unary_stream_rpc_method_handler( servicer.GetStream_kpi, Loading @@ -91,76 +96,3 @@ def add_MonitoringServiceServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'monitoring.MonitoringService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class MonitoringService(object): """Missing associated documentation comment in .proto file.""" @staticmethod def IncludeKpi(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/IncludeKpi', monitoring__pb2.Kpi.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MonitorKpi(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/MonitorKpi', monitoring__pb2.KpiDevice.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetStream_kpi(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/monitoring.MonitoringService/GetStream_kpi', monitoring__pb2.KpiId.SerializeToString, monitoring__pb2.Kpi.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetInstantKpi(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/GetInstantKpi', monitoring__pb2.KpiId.SerializeToString, monitoring__pb2.Kpi.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) src/monitoring/monitoring_server.py +9 −0 Original line number Diff line number Diff line Loading @@ -19,9 +19,16 @@ from logger import getJSONLogger logger = getJSONLogger('monitoringservice-server') logger.setLevel('DEBUG') from prometheus_client import start_http_server, Summary import threading from prometheus_client import start_http_server, Summary from prometheus_client import Counter, Gauge MONITORING_GETINSTANTKPI_REQUEST_TIME = Summary('monitoring_getinstantkpi_processing_seconds', 'Time spent processing monitoring instant kpi request') MONITORING_INCLUDEKPI_COUNTER = Counter('monitoring_includekpi_counter', 'Monitoring include kpi request counter') class monitoringService(monitoring_pb2_grpc.MonitoringServiceServicer): def __init__(self): Loading @@ -31,6 +38,7 @@ class monitoringService(monitoring_pb2_grpc.MonitoringServiceServicer): def IncludeKpi(self, request, context): #KPI, returns empty logger.info("IncludeKpi") MONITORING_INCLUDEKPI_COUNTER.inc() return Loading @@ -44,6 +52,7 @@ class monitoringService(monitoring_pb2_grpc.MonitoringServiceServicer): logger.info("IncludeKpi") return @MONITORING_GETINSTANTKPI_REQUEST_TIME.time() def GetInstantKpi ( self, request, context): #KpiId ) returns ( Kpi) {} logger.info("IncludeKpi") Loading Loading
src/monitoring/context_pb2.py +146 −133 File changed.Preview size limit exceeded, changes collapsed. Show changes
src/monitoring/context_pb2_grpc.py +30 −51 Original line number Diff line number Diff line # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc import context_pb2 as context__pb2 from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 class ContextServiceStub(object): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Loading @@ -17,16 +16,18 @@ class ContextServiceStub(object): """ self.GetTopology = channel.unary_unary( '/context.ContextService/GetTopology', request_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, request_serializer=context__pb2.Empty.SerializeToString, response_deserializer=context__pb2.Topology.FromString, ) class ContextServiceServicer(object): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass def GetTopology(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') Loading @@ -36,32 +37,10 @@ def add_ContextServiceServicer_to_server(servicer, server): rpc_method_handlers = { 'GetTopology': grpc.unary_unary_rpc_method_handler( servicer.GetTopology, request_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, request_deserializer=context__pb2.Empty.FromString, response_serializer=context__pb2.Topology.SerializeToString, ), } generic_handler = grpc.method_handlers_generic_handler( 'context.ContextService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class ContextService(object): """Missing associated documentation comment in .proto file.""" @staticmethod def GetTopology(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/context.ContextService/GetTopology', google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, context__pb2.Topology.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
src/monitoring/monitoring_pb2.py +54 −67 Original line number Diff line number Diff line # -*- coding: utf-8 -*- # Generated by the protocol buffer compiler. DO NOT EDIT! # source: monitoring.proto """Generated protocol buffer code.""" import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection Loading @@ -11,7 +12,6 @@ from google.protobuf import symbol_database as _symbol_database _sym_db = _symbol_database.Default() from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 Loading @@ -20,10 +20,9 @@ DESCRIPTOR = _descriptor.FileDescriptor( package='monitoring', syntax='proto3', serialized_options=None, create_key=_descriptor._internal_create_key, serialized_pb=b'\n\x10monitoring.proto\x12\nmonitoring\x1a\x1bgoogle/protobuf/empty.proto\x1a\rcontext.proto\"|\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x16\n\x0ekpiDescription\x18\x03 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"T\n\tKpiDevice\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"+\n\x07KpiList\x12 \n\x07kpiList\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi\"M\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x13\n\tstringVal\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value2\xfb\x01\n\x11MonitoringService\x12\x37\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x16.google.protobuf.Empty\"\x00\x12=\n\nMonitorKpi\x12\x15.monitoring.KpiDevice\x1a\x16.google.protobuf.Empty\"\x00\x12\x37\n\rGetStream_kpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3' serialized_pb=_b('\n\x10monitoring.proto\x12\nmonitoring\x1a\rcontext.proto\"|\n\x03Kpi\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12\x11\n\ttimestamp\x18\x02 \x01(\t\x12\x16\n\x0ekpiDescription\x18\x03 \x01(\t\x12\'\n\tkpi_value\x18\x04 \x01(\x0b\x32\x14.monitoring.KpiValue\"&\n\x05KpiId\x12\x1d\n\x06kpi_id\x18\x01 \x01(\x0b\x32\r.context.Uuid\"T\n\tKpiDevice\x12!\n\x06kpi_id\x18\x01 \x01(\x0b\x32\x11.monitoring.KpiId\x12$\n\tdevice_id\x18\x02 \x01(\x0b\x32\x11.context.DeviceId\"+\n\x07KpiList\x12 \n\x07kpiList\x18\x01 \x03(\x0b\x32\x0f.monitoring.Kpi\"M\n\x08KpiValue\x12\x10\n\x06intVal\x18\x01 \x01(\rH\x00\x12\x13\n\tstringVal\x18\x02 \x01(\tH\x00\x12\x11\n\x07\x62oolVal\x18\x03 \x01(\x08H\x00\x42\x07\n\x05value2\xeb\x01\n\x11MonitoringService\x12/\n\nIncludeKpi\x12\x0f.monitoring.Kpi\x1a\x0e.context.Empty\"\x00\x12\x35\n\nMonitorKpi\x12\x15.monitoring.KpiDevice\x1a\x0e.context.Empty\"\x00\x12\x37\n\rGetStream_kpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x30\x01\x12\x35\n\rGetInstantKpi\x12\x11.monitoring.KpiId\x1a\x0f.monitoring.Kpi\"\x00\x62\x06proto3') , dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,context__pb2.DESCRIPTOR,]) dependencies=[context__pb2.DESCRIPTOR,]) Loading @@ -34,7 +33,6 @@ _KPI = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpi_id', full_name='monitoring.Kpi.kpi_id', index=0, Loading @@ -42,28 +40,28 @@ _KPI = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='timestamp', full_name='monitoring.Kpi.timestamp', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kpiDescription', full_name='monitoring.Kpi.kpiDescription', index=2, number=3, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='kpi_value', full_name='monitoring.Kpi.kpi_value', index=3, number=4, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -76,8 +74,8 @@ _KPI = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], serialized_start=76, serialized_end=200, serialized_start=47, serialized_end=171, ) Loading @@ -87,7 +85,6 @@ _KPIID = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpi_id', full_name='monitoring.KpiId.kpi_id', index=0, Loading @@ -95,7 +92,7 @@ _KPIID = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -108,8 +105,8 @@ _KPIID = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], serialized_start=202, serialized_end=240, serialized_start=173, serialized_end=211, ) Loading @@ -119,7 +116,6 @@ _KPIDEVICE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpi_id', full_name='monitoring.KpiDevice.kpi_id', index=0, Loading @@ -127,14 +123,14 @@ _KPIDEVICE = _descriptor.Descriptor( has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='device_id', full_name='monitoring.KpiDevice.device_id', index=1, number=2, type=11, cpp_type=10, label=1, has_default_value=False, default_value=None, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -147,8 +143,8 @@ _KPIDEVICE = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], serialized_start=242, serialized_end=326, serialized_start=213, serialized_end=297, ) Loading @@ -158,7 +154,6 @@ _KPILIST = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='kpiList', full_name='monitoring.KpiList.kpiList', index=0, Loading @@ -166,7 +161,7 @@ _KPILIST = _descriptor.Descriptor( has_default_value=False, default_value=[], message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -179,8 +174,8 @@ _KPILIST = _descriptor.Descriptor( extension_ranges=[], oneofs=[ ], serialized_start=328, serialized_end=371, serialized_start=299, serialized_end=342, ) Loading @@ -190,7 +185,6 @@ _KPIVALUE = _descriptor.Descriptor( filename=None, file=DESCRIPTOR, containing_type=None, create_key=_descriptor._internal_create_key, fields=[ _descriptor.FieldDescriptor( name='intVal', full_name='monitoring.KpiValue.intVal', index=0, Loading @@ -198,21 +192,21 @@ _KPIVALUE = _descriptor.Descriptor( has_default_value=False, default_value=0, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='stringVal', full_name='monitoring.KpiValue.stringVal', index=1, number=2, type=9, cpp_type=9, label=1, has_default_value=False, default_value=b"".decode('utf-8'), has_default_value=False, default_value=_b("").decode('utf-8'), message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), _descriptor.FieldDescriptor( name='boolVal', full_name='monitoring.KpiValue.boolVal', index=2, number=3, type=8, cpp_type=7, label=1, has_default_value=False, default_value=False, message_type=None, enum_type=None, containing_type=None, is_extension=False, extension_scope=None, serialized_options=None, file=DESCRIPTOR, create_key=_descriptor._internal_create_key), serialized_options=None, file=DESCRIPTOR), ], extensions=[ ], Loading @@ -226,12 +220,10 @@ _KPIVALUE = _descriptor.Descriptor( oneofs=[ _descriptor.OneofDescriptor( name='value', full_name='monitoring.KpiValue.value', index=0, containing_type=None, create_key=_descriptor._internal_create_key, fields=[]), index=0, containing_type=None, fields=[]), ], serialized_start=373, serialized_end=450, serialized_start=344, serialized_end=421, ) _KPI.fields_by_name['kpi_id'].message_type = _KPIID Loading @@ -256,39 +248,39 @@ DESCRIPTOR.message_types_by_name['KpiList'] = _KPILIST DESCRIPTOR.message_types_by_name['KpiValue'] = _KPIVALUE _sym_db.RegisterFileDescriptor(DESCRIPTOR) Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), { 'DESCRIPTOR' : _KPI, '__module__' : 'monitoring_pb2' Kpi = _reflection.GeneratedProtocolMessageType('Kpi', (_message.Message,), dict( DESCRIPTOR = _KPI, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.Kpi) }) )) _sym_db.RegisterMessage(Kpi) KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), { 'DESCRIPTOR' : _KPIID, '__module__' : 'monitoring_pb2' KpiId = _reflection.GeneratedProtocolMessageType('KpiId', (_message.Message,), dict( DESCRIPTOR = _KPIID, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiId) }) )) _sym_db.RegisterMessage(KpiId) KpiDevice = _reflection.GeneratedProtocolMessageType('KpiDevice', (_message.Message,), { 'DESCRIPTOR' : _KPIDEVICE, '__module__' : 'monitoring_pb2' KpiDevice = _reflection.GeneratedProtocolMessageType('KpiDevice', (_message.Message,), dict( DESCRIPTOR = _KPIDEVICE, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiDevice) }) )) _sym_db.RegisterMessage(KpiDevice) KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), { 'DESCRIPTOR' : _KPILIST, '__module__' : 'monitoring_pb2' KpiList = _reflection.GeneratedProtocolMessageType('KpiList', (_message.Message,), dict( DESCRIPTOR = _KPILIST, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiList) }) )) _sym_db.RegisterMessage(KpiList) KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), { 'DESCRIPTOR' : _KPIVALUE, '__module__' : 'monitoring_pb2' KpiValue = _reflection.GeneratedProtocolMessageType('KpiValue', (_message.Message,), dict( DESCRIPTOR = _KPIVALUE, __module__ = 'monitoring_pb2' # @@protoc_insertion_point(class_scope:monitoring.KpiValue) }) )) _sym_db.RegisterMessage(KpiValue) Loading @@ -299,9 +291,8 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( file=DESCRIPTOR, index=0, serialized_options=None, create_key=_descriptor._internal_create_key, serialized_start=453, serialized_end=704, serialized_start=424, serialized_end=659, methods=[ _descriptor.MethodDescriptor( name='IncludeKpi', Loading @@ -309,9 +300,8 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( index=0, containing_service=None, input_type=_KPI, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, output_type=context__pb2._EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='MonitorKpi', Loading @@ -319,9 +309,8 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( index=1, containing_service=None, input_type=_KPIDEVICE, output_type=google_dot_protobuf_dot_empty__pb2._EMPTY, output_type=context__pb2._EMPTY, serialized_options=None, create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetStream_kpi', Loading @@ -331,7 +320,6 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIID, output_type=_KPI, serialized_options=None, create_key=_descriptor._internal_create_key, ), _descriptor.MethodDescriptor( name='GetInstantKpi', Loading @@ -341,7 +329,6 @@ _MONITORINGSERVICE = _descriptor.ServiceDescriptor( input_type=_KPIID, output_type=_KPI, serialized_options=None, create_key=_descriptor._internal_create_key, ), ]) _sym_db.RegisterServiceDescriptor(_MONITORINGSERVICE) Loading
src/monitoring/monitoring_pb2_grpc.py +85 −153 Original line number Diff line number Diff line # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! """Client and server classes corresponding to protobuf-defined services.""" import grpc from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2 import context_pb2 as context__pb2 import monitoring_pb2 as monitoring__pb2 class MonitoringServiceStub(object): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass def __init__(self, channel): """Constructor. Loading @@ -18,12 +18,12 @@ class MonitoringServiceStub(object): self.IncludeKpi = channel.unary_unary( '/monitoring.MonitoringService/IncludeKpi', request_serializer=monitoring__pb2.Kpi.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, response_deserializer=context__pb2.Empty.FromString, ) self.MonitorKpi = channel.unary_unary( '/monitoring.MonitoringService/MonitorKpi', request_serializer=monitoring__pb2.KpiDevice.SerializeToString, response_deserializer=google_dot_protobuf_dot_empty__pb2.Empty.FromString, response_deserializer=context__pb2.Empty.FromString, ) self.GetStream_kpi = channel.unary_stream( '/monitoring.MonitoringService/GetStream_kpi', Loading @@ -38,28 +38,33 @@ class MonitoringServiceStub(object): class MonitoringServiceServicer(object): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass def IncludeKpi(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def MonitorKpi(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetStream_kpi(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') def GetInstantKpi(self, request, context): """Missing associated documentation comment in .proto file.""" # missing associated documentation comment in .proto file pass context.set_code(grpc.StatusCode.UNIMPLEMENTED) context.set_details('Method not implemented!') raise NotImplementedError('Method not implemented!') Loading @@ -70,12 +75,12 @@ def add_MonitoringServiceServicer_to_server(servicer, server): 'IncludeKpi': grpc.unary_unary_rpc_method_handler( servicer.IncludeKpi, request_deserializer=monitoring__pb2.Kpi.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_serializer=context__pb2.Empty.SerializeToString, ), 'MonitorKpi': grpc.unary_unary_rpc_method_handler( servicer.MonitorKpi, request_deserializer=monitoring__pb2.KpiDevice.FromString, response_serializer=google_dot_protobuf_dot_empty__pb2.Empty.SerializeToString, response_serializer=context__pb2.Empty.SerializeToString, ), 'GetStream_kpi': grpc.unary_stream_rpc_method_handler( servicer.GetStream_kpi, Loading @@ -91,76 +96,3 @@ def add_MonitoringServiceServicer_to_server(servicer, server): generic_handler = grpc.method_handlers_generic_handler( 'monitoring.MonitoringService', rpc_method_handlers) server.add_generic_rpc_handlers((generic_handler,)) # This class is part of an EXPERIMENTAL API. class MonitoringService(object): """Missing associated documentation comment in .proto file.""" @staticmethod def IncludeKpi(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/IncludeKpi', monitoring__pb2.Kpi.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def MonitorKpi(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/MonitorKpi', monitoring__pb2.KpiDevice.SerializeToString, google_dot_protobuf_dot_empty__pb2.Empty.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetStream_kpi(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_stream(request, target, '/monitoring.MonitoringService/GetStream_kpi', monitoring__pb2.KpiId.SerializeToString, monitoring__pb2.Kpi.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata) @staticmethod def GetInstantKpi(request, target, options=(), channel_credentials=None, call_credentials=None, insecure=False, compression=None, wait_for_ready=None, timeout=None, metadata=None): return grpc.experimental.unary_unary(request, target, '/monitoring.MonitoringService/GetInstantKpi', monitoring__pb2.KpiId.SerializeToString, monitoring__pb2.Kpi.FromString, options, channel_credentials, insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
src/monitoring/monitoring_server.py +9 −0 Original line number Diff line number Diff line Loading @@ -19,9 +19,16 @@ from logger import getJSONLogger logger = getJSONLogger('monitoringservice-server') logger.setLevel('DEBUG') from prometheus_client import start_http_server, Summary import threading from prometheus_client import start_http_server, Summary from prometheus_client import Counter, Gauge MONITORING_GETINSTANTKPI_REQUEST_TIME = Summary('monitoring_getinstantkpi_processing_seconds', 'Time spent processing monitoring instant kpi request') MONITORING_INCLUDEKPI_COUNTER = Counter('monitoring_includekpi_counter', 'Monitoring include kpi request counter') class monitoringService(monitoring_pb2_grpc.MonitoringServiceServicer): def __init__(self): Loading @@ -31,6 +38,7 @@ class monitoringService(monitoring_pb2_grpc.MonitoringServiceServicer): def IncludeKpi(self, request, context): #KPI, returns empty logger.info("IncludeKpi") MONITORING_INCLUDEKPI_COUNTER.inc() return Loading @@ -44,6 +52,7 @@ class monitoringService(monitoring_pb2_grpc.MonitoringServiceServicer): logger.info("IncludeKpi") return @MONITORING_GETINSTANTKPI_REQUEST_TIME.time() def GetInstantKpi ( self, request, context): #KpiId ) returns ( Kpi) {} logger.info("IncludeKpi") Loading