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

        for iface in net:
            name = self.normalize_device_name(iface.name)
            if iface.BytesReceivedPerSec is not None:
                self.save_sample('system.net.bytes_rcvd', iface.BytesReceivedPerSec,
                                 device_name=name)
            if iface.BytesSentPerSec is not None:
                self.save_sample('system.net.bytes_sent', iface.BytesSentPerSec,
                                 device_name=name)
        return self.get_metrics()
dataset/ETHPy150Open serverdensity/sd-agent/checks/system/win32.py/Network.check