def _register_psutil_metrics(self, stats, names_to_metric_types):

        base_metric = 'datadog.agent.collector.{0}.{1}'
        # TODO: May have to call self.normalize(metric_name) to get a compliant name
        for k, v in stats.iteritems():
            metric_type = names_to_metric_types[k]
            if isinstance(v, dict):
                for _k, _v in v.iteritems():
                    full_metric_name = base_metric.format(k, _k)
                    self._send_single_metric(full_metric_name, _v, metric_type)
            else:
                full_metric_name = 'datadog.agent.collector.{0}'.format(k)
                self._send_single_metric(full_metric_name, v, metric_type)
CheckPrereq checks related to disk changes.
dataset/ETHPy150Open serverdensity/sd-agent/checks.d/agent_metrics.py/AgentMetrics._register_psutil_metrics--crossover with--dataset/ETHPy150Open ganeti/ganeti/lib/cmdlib/instance_set_params.py/LUInstanceSetParams._PreCheckDisks