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
Test BaseModel.DeleteMemcacheWrap().
dataset/ETHPy150Open serverdensity/sd-agent/checks/system/win32.py/Cpu._average_metric--crossover with--dataset/ETHPy150Open google/simian/src/tests/simian/mac/models/base_test.py/ModelsModuleTest.testBaseModelDeleteMemcacheWrap