Did I find the right examples for you? yes no

All Samples(25)  |  Call(25)  |  Derive(0)  |  Import(0)
Return network I/O statistics as a namedtuple including
the following attributes:

 - bytes_sent:   number of bytes sent
 - bytes_recv:   number of bytes received
 - packets_sent: number of packets sent
 - packets_recv: number of packets received
 - errin:        total number of errors while receiving
 - errout:       total number of errors while sending
 - dropin:       total number of incoming packets which were dropped(more...)

        def net_io_counters(pernic=False):
    """Return network I/O statistics as a namedtuple including
    the following attributes:

     - bytes_sent:   number of bytes sent
     - bytes_recv:   number of bytes received
     - packets_sent: number of packets sent
     - packets_recv: number of packets received
     - errin:        total number of errors while receiving
     - errout:       total number of errors while sending
     - dropin:       total number of incoming packets which were dropped
     - dropout:      total number of outgoing packets which were dropped
                     (always 0 on OSX and BSD)

    If pernic is True return the same information for every
    network interface installed on the system as a dictionary
    with network interface names as the keys and the namedtuple
    described above as the values.
    """
    rawdict = _psplatform.net_io_counters()
    if not rawdict:
        raise RuntimeError("couldn't find any network interface")
    if pernic:
        for nic, fields in rawdict.items():
            rawdict[nic] = _nt_net_iostat(*fields)
        return rawdict
    else:
        return _nt_net_iostat(*[sum(x) for x in zip(*rawdict.values())])
        


src/p/s/psutil-2.1.1/examples/nettop.py   psutil(Download)
def poll(interval):
    """Retrieve raw stats within an interval window."""
    tot_before = psutil.net_io_counters()
    pnic_before = psutil.net_io_counters(pernic=True)
    # sleep some time
    time.sleep(interval)
    tot_after = psutil.net_io_counters()
    pnic_after = psutil.net_io_counters(pernic=True)

src/g/l/Glances-1.7.6/glances/glances.py   Glances(Download)
try:
    # psutil.net_io_counters() only available from psutil >= 1.0.0
    psutil.net_io_counters()
except Exception:
    psutil_net_io_counters = False
                # psutil >= 1.0.0
                try:
                    get_net_io_counters = psutil.net_io_counters(pernic=True)
                except IOError:
                    self.network_error_tag = True

src/g/l/glances-HEAD/glances/glances.py   glances(Download)
try:
    # psutil.net_io_counters() only available from psutil >= 1.0.0
    psutil.net_io_counters()
except Exception:
    psutil_net_io_counters = False
                # psutil >= 1.0.0
                try:
                    get_net_io_counters = psutil.net_io_counters(pernic=True)
                except IOError:
                    self.network_error_tag = True

src/p/o/powerline-status-0.0.1/powerline/segments/common.py   powerline-status(Download)
	def _get_bytes(interface):
		try:
			io_counters = psutil.net_io_counters(pernic=True)
		except AttributeError:
			io_counters = psutil.network_io_counters(pernic=True)

src/p/o/powerline-HEAD/powerline/segments/common.py   powerline(Download)
	def _get_bytes(interface):
		try:
			io_counters = psutil.net_io_counters(pernic=True)
		except AttributeError:
			io_counters = psutil.network_io_counters(pernic=True)

src/p/s/psdash-0.3.0/psdash/net.py   psdash(Download)
        dicts with the additional attributes defaulted
        """
        counters = psutil.net_io_counters(pernic=self.pernic)
 
        res = {}

src/p/s/psdash-HEAD/psdash/net.py   psdash(Download)
        dicts with the additional attributes defaulted
        """
        counters = psutil.net_io_counters(pernic=self.pernic)
 
        res = {}

src/p/y/pyfarm.core-0.7.16/pyfarm/core/sysinfo/network.py   pyfarm.core(Download)
def iocounter():
    """
    Mapping to the internal network io counter class
    """
    values = psutil.net_io_counters(pernic=True)
    # is the interface dns provides
    sums = []
    counters = psutil.net_io_counters(pernic=True)
 
    for address in addresses():

src/s/i/sillyfacter-0.3.2.2/sillyfacter/network.py   sillyfacter(Download)
    #
    l.info("Gathering network info...")
    nwio = psutil.net_io_counters(pernic=True)
    nw = []
    for i in netifaces.interfaces():

src/n/e/newRHELic-HEAD/newrelic.py   newRHELic(Download)
    def _get_net_stats(self):
        '''This will form network IO stats for the entire system'''
        try:
            io = psutil.net_io_counters()
 
    def _prep_first_run(self):
        '''this will prime the needed buffers to present valid data when math is needed'''
        try:
            #create the first counter values to do math against for network, disk and swap
            net_io = psutil.net_io_counters()

  1 | 2  Next