(self, tags=None)
Collect metrics about interfaces counters using psutil
Collect metrics about interfaces counters using psutil
Collect metrics about interfaces counters using psutil
def _cx_counters_psutil(self, tags=None):
        """
        Collect metrics about interfaces counters using psutil
        """
        tags = [] if tags is None else tags
        for iface, counters in iteritems(psutil.net_io_counters(pernic=True)):
            metrics = {
                'bytes_rcvd': counters.bytes_recv,
                'bytes_sent': counters.bytes_sent,
                'packets_in.count': counters.packets_recv,
                'packets_in.error': counters.errin,
                'packets_out.count': counters.packets_sent,
                'packets_out.error': counters.errout,
            }
            self._submit_devicemetrics(iface, metrics, tags)
def _cx_counters_psutil ( self , tags = None ) : tags = [ ] if tags is None else tags for iface , counters in iteritems ( psutil . net_io_counters ( pernic = True ) ) : metrics = { 'bytes_rcvd' : counters . bytes_recv , 'bytes_sent' : counters . bytes_sent , 'packets_in.count' : counters . packets_recv , 'packets_in.error' : counters . errin , 'packets_out.count' : counters . packets_sent , 'packets_out.error' : counters . errout , } self . _submit_devicemetrics ( iface , metrics , tags )