def _average_metric(self, wmi_class, wmi_prop):
        val = 0
        counter = 0
        for wmi_object in wmi_class:
            if wmi_object.Name == '_Total':
                # Skip the _Total value
                continue

            if getattr(wmi_object, wmi_prop) is not None:
                counter += 1
                val += float(getattr(wmi_object, wmi_prop))

        if counter > 0:
            return val / counter

        return val
Sum all of the values of a metric from a WMI class object, excluding
dataset/ETHPy150Open serverdensity/sd-agent/checks/system/win32.py/Cpu._average_metric