From dd0f90fad5e20056bf2e2f2b799464b88391ce84 Mon Sep 17 00:00:00 2001 From: Waleed Akbar <wakbar@cttc.es> Date: Thu, 25 Apr 2024 10:14:37 +0000 Subject: [PATCH] "StartCollector" method dummy defination added --- .../TelemetryFrontendServiceServicerImpl.py | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/telemetry_frontend/service/TelemetryFrontendServiceServicerImpl.py b/src/telemetry_frontend/service/TelemetryFrontendServiceServicerImpl.py index f80ccfd52..6ffb78ab1 100644 --- a/src/telemetry_frontend/service/TelemetryFrontendServiceServicerImpl.py +++ b/src/telemetry_frontend/service/TelemetryFrontendServiceServicerImpl.py @@ -10,4 +10,29 @@ # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and -# limitations under the License. \ No newline at end of file +# limitations under the License. + +import logging +from monitoring.service.NameMapping import NameMapping +from common.proto.telemetry_frontend_pb2 import CollectorId, Collector +from common.method_wrappers.Decorator import MetricsPool, safe_and_metered_rpc_method +from common.proto.telemetry_frontend_pb2_grpc import TelemetryFrontendServiceServicer + + +LOGGER = logging.getLogger(__name__) +METRICS_POOL = MetricsPool('Monitoring', 'TelemetryFrontend') + +class TelemetryFrontendServiceServicerImpl(TelemetryFrontendServiceServicer): + def __init__(self, name_mapping : NameMapping): + LOGGER.info('Init TelemetryFrontendService') + + @safe_and_metered_rpc_method(METRICS_POOL, LOGGER) + def StartCollector(self, request: Collector) -> CollectorId: + response = CollectorId() + collector_id = request.collector_id + collector_kpi_id = request.kpi_id + collector_duration = request.duration_s + collector_interval = request.interval_s + + response.collector_id.uuid = request.collector_id.uuid + return response \ No newline at end of file -- GitLab