(self, iface)
return {}
Collect ENA metrics for given interface.

        ENA metrics are collected via the ioctl SIOCETHTOOL call. At the time of writing
        this method, there are no maintained Python libraries that do this. The solution
        is based on:

        * https://github.com/safchain/ethtool
        * https://gist.github.com/yunazuno/d7cd7e1e127a39192834c75d85d45df9
Collect ENA metrics for given interface.
Collect ENA metrics for given interface .
def _collect_ena(self, iface):
        """
        Collect ENA metrics for given interface.

        ENA metrics are collected via the ioctl SIOCETHTOOL call. At the time of writing
        this method, there are no maintained Python libraries that do this. The solution
        is based on:

        * https://github.com/safchain/ethtool
        * https://gist.github.com/yunazuno/d7cd7e1e127a39192834c75d85d45df9
        """
        ethtool_socket = None
        try:
            ethtool_socket = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 0)
            return self._get_ena_metrics(iface, ethtool_socket)
        except OSError as e:
            # this will happen for interfaces that don't support SIOCETHTOOL - e.g. loopback or docker
            self.log.debug('OSError while trying to collect ENA metrics for interface %s: %s', iface, str(e))
        except Exception:
            self.log.exception('Unable to collect ENA metrics for interface %s', iface)
        finally:
            if ethtool_socket is not None:
                ethtool_socket.close()
        return {}
def _collect_ena ( self , iface ) : ethtool_socket = None try : ethtool_socket = socket . socket ( socket . AF_INET , socket . SOCK_DGRAM , 0 ) return self . _get_ena_metrics ( iface , ethtool_socket ) except OSError as e : # this will happen for interfaces that don't support SIOCETHTOOL - e.g. loopback or docker self . log . debug ( 'OSError while trying to collect ENA metrics for interface %s: %s' , iface , str ( e ) ) except Exception : self . log . exception ( 'Unable to collect ENA metrics for interface %s' , iface ) finally : if ethtool_socket is not None : ethtool_socket . close ( ) return { }