def check(self, agentConfig):
        try:
            cpu = w.Win32_PerfFormattedData_PerfOS_Processor()
        except __HOLE__:
            self.logger.info('Missing Win32_PerfFormattedData_PerfOS_Processor WMI class.'
                             ' No CPU metrics will be returned.')
            return

        cpu_interrupt = self._average_metric(cpu, 'PercentInterruptTime')
        if cpu_interrupt is not None:
            self.save_sample('system.cpu.interrupt', cpu_interrupt)

        cpu_percent = psutil.cpu_times()

        self.save_sample('system.cpu.user', 100 * cpu_percent.user / psutil.NUM_CPUS)
        self.save_sample('system.cpu.idle', 100 * cpu_percent.idle / psutil.NUM_CPUS)
        self.save_sample('system.cpu.system', 100 * cpu_percent.system / psutil.NUM_CPUS)

        return self.get_metrics()
dataset/ETHPy150Open serverdensity/sd-agent/checks/system/win32.py/Cpu.check