'Get the metrics from monitors and
notify information to message bus.'

def _get_host_metrics(self, context, nodename):

    metrics = objects.MonitorMetricList()
    metrics_info = {}
    for monitor in self.monitors:
        try:
            monitor.populate_metrics(metrics)
        except NotImplementedError:
            LOG.debug("The    compute    driver    doesn't    support    host    metrics    for        %(mon)s", {'mon': monitor})
        except Exception as exc:
            LOG.warning('Cannot    get    the    metrics    from    %(mon)s;    error:    %(exc)s', {'mon': monitor, 'exc': exc})
    metrics = metrics.to_list()
    if len(metrics):
        metrics_info['nodename'] = nodename
        metrics_info['metrics'] = metrics
        metrics_info['host'] = self.host
        metrics_info['host_ip'] = CONF.my_ip
        notifier = rpc.get_notifier(service='compute', host=nodename)
        notifier.info(context, 'compute.metrics.update', metrics_info)
    return metrics
