- def _collect_vim_metrics(self, vnfr: dict, vim_account_id: str):
- # TODO(diazb) Add support for aws
- database_manager = DatabaseManager(self.conf)
- vim_type = database_manager.get_vim_type(vim_account_id)
- if vim_type in VIM_COLLECTORS:
- collector = VIM_COLLECTORS[vim_type](self.conf, vim_account_id)
- metrics = collector.collect(vnfr)
- for metric in metrics:
- self.queue.put(metric)
- else:
- log.debug("vimtype %s is not supported.", vim_type)
-
- def _collect_vim_infra_metrics(self, vim_account_id: str):
- database_manager = DatabaseManager(self.conf)
- vim_type = database_manager.get_vim_type(vim_account_id)
- if vim_type in VIM_INFRA_COLLECTORS:
- collector = VIM_INFRA_COLLECTORS[vim_type](self.conf, vim_account_id)
- metrics = collector.collect()
- for metric in metrics:
- self.queue.put(metric)
- else:
- log.debug("vimtype %s is not supported.", vim_type)
-
- 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)
-