Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

psutil_net_io_counters on Solaris has send and received swapped #611

Closed
grobian opened this issue Mar 28, 2015 · 1 comment
Closed

psutil_net_io_counters on Solaris has send and received swapped #611

grobian opened this issue Mar 28, 2015 · 1 comment
Labels

Comments

@grobian
Copy link
Contributor

grobian commented Mar 28, 2015

Python code:

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

     - bytes_sent:   number of bytes sent
     - bytes_recv:   number of bytes received
     - packets_sent: number of packets sent
     - packets_recv: number of packets received

C-code however, has them swapped (psutil/_psutil_sunos.c):

        py_ifc_info = Py_BuildValue("(KKKKkkii)",
                                    rbytes->value.ui64,
                                    wbytes->value.ui64,
                                    rpkts->value.ui64,
                                    wpkts->value.ui64,

I can come up with a simple patch, but I figure it's obvious what needs to be changed :)

@giampaolo
Copy link
Owner

Please submit a pull request (and also update HISTORY.rst and CREDITS.rst).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants