def check(self, agentConfig):
        try:
            os = w.Win32_PerfFormattedData_PerfOS_System()[0]
        except AttributeError:
            self.logger.info('Missing Win32_PerfFormattedData_PerfOS_System WMI class.'
                             ' No process metrics will be returned.')
            return

        try:
            cpu = w.Win32_PerfFormattedData_PerfOS_Processor(name="_Total")[0]
        except __HOLE__:
            self.logger.info('Missing Win32_PerfFormattedData_PerfOS_Processor WMI class.'
                             ' No process metrics will be returned.')
            return
        if os.ProcessorQueueLength is not None:
            self.save_sample('system.proc.queue_length', os.ProcessorQueueLength)
        if os.Processes is not None:
            self.save_sample('system.proc.count', os.Processes)

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