- def _init_vca_collector_and_collect(self, vnfr: dict, queue: multiprocessing.Queue):
- vca_collector = VCACollector()
- vca_collector.collect(vnfr, queue)
+ def _collect_sdnc_infra_metrics(self, sdnc_id: str):
+ common_db = CommonDbClient(self.conf)
+ sdn_type = common_db.get_sdnc(sdnc_id)['type']
+ if sdn_type in SDN_INFRA_COLLECTORS:
+ collector = SDN_INFRA_COLLECTORS[sdn_type](self.conf, sdnc_id)
+ metrics = collector.collect()
+ for metric in metrics:
+ self.queue.put(metric)
+ else:
+ log.debug("sdn_type %s is not supported.", sdn_type)
+
+ def _collect_vca_metrics(self, vnfr: dict):
+ log.debug('_collect_vca_metrics')
+ log.debug('vnfr: %s', vnfr)
+ vca_collector = VCACollector(self.conf)
+ metrics = vca_collector.collect(vnfr)
+ for metric in metrics:
+ self.queue.put(metric)