Commit 77f86782 authored by Waleed Akbar's avatar Waleed Akbar
Browse files

fix: Comment out unused telemetry resource handling in EventDispatcher.

parent fa85d488
Loading
Loading
Loading
Loading
+17 −17
Original line number Diff line number Diff line
@@ -356,32 +356,32 @@ class EventDispatcher(BaseEventDispatcher):
        te_link = te_topo.link(link_name)
        te_link.update(src_device.name, src_endpoint.name, dst_device.name, dst_endpoint.name)

        worker_name = '{:s}:{:s}'.format(topology_name, link_name)
        resources   = Resources()
        resources.links.append(ResourceLink(
            domain_name = topology_name, 
            link_name   = link_name,
            metrics_sampler = SyntheticSampler.create_random(
                connection_count = 0,
                link_capacity    = LINKS_CAPACITY.get(link_name, 100.0)
            ),
            related_service_ids=[],
        ))
        sampling_interval = 1.0
        self._telemetry_pool.start_synthesizer(worker_name, resources, sampling_interval)
        # worker_name = '{:s}:{:s}'.format(topology_name, link_name)
        # resources   = Resources()
        # resources.links.append(ResourceLink(
        #     domain_name = topology_name, 
        #     link_name   = link_name,
        #     metrics_sampler = SyntheticSampler.create_random(
        #         connection_count = 0,
        #         link_capacity    = LINKS_CAPACITY.get(link_name, 100.0)
        #     ),
        #     related_service_ids=[],
        # ))
        # sampling_interval = 1.0
        # self._telemetry_pool.start_synthesizer(worker_name, resources, sampling_interval)

        return True


    def dispatch_link_create(self, link_event : LinkEvent) -> None:
        # if not self._dispatch_link_set(link_event): return
        if not self._dispatch_link_set(link_event): return

        MSG = 'Link Created: {:s}'
        LOGGER.info(MSG.format(grpc_message_to_json_string(link_event)))


    def dispatch_link_update(self, link_event : LinkEvent) -> None:
        # if not self._dispatch_link_set(link_event): return
        if not self._dispatch_link_set(link_event): return

        MSG = 'Link Updated: {:s}'
        LOGGER.info(MSG.format(grpc_message_to_json_string(link_event)))
@@ -435,8 +435,8 @@ class EventDispatcher(BaseEventDispatcher):
        self._object_cache.delete(CachedEntities.LINK, link_uuid)
        self._object_cache.delete(CachedEntities.LINK, link_name)

        worker_name = '{:s}:{:s}'.format(topology_name, link_name)
        self._telemetry_pool.stop_worker(WorkerTypeEnum.SYNTHESIZER, worker_name)
        # worker_name = '{:s}:{:s}'.format(topology_name, link_name)
        # self._telemetry_pool.stop_worker(WorkerTypeEnum.SYNTHESIZER, worker_name)

        MSG = 'Link Removed: {:s}'
        LOGGER.info(MSG.format(grpc_message_to_json_string(link_event)))