stupidcache / psutil

Automatically exported from code.google.com/p/psutil
Other
0 stars 0 forks source link

Write disk/network I/O tests that compare against external data #210

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
While working on Issue 150 and Issue 206, we discussed the desire to use a 
command-line approach for gathering disk/network I/O information from outside 
of psutil and then comparing said information to what psutil gathers for 
disk/network I/O to make sure psutil is gathering valid data.  Since this will 
likely be bigger than initially realized due to differences in utilities like 
iostat/netstat across platforms, I figured I'd create a separate issue for this 
work.  I already have a working OS X implementation but it isn't written in a 
way to only enable itself when ran on OS X.  (I tested Ubuntu Linux for this 
patch and of course iostat/netstat both behave differently on Ubuntu than on OS 
X, hence the difficulty I mentioned earlier.)  I will go ahead and attach a 
patch that performs the following (ONLY WORKS ON OS X):

* Use 'netstat -bi' to validate that psutil.network_io_counters() works properly
* Use 'iostat -dI' to validate that psutil.disk_io_counters() works properly

The patch is here to serve as a thought-provoking conversation starter instead 
of a real solution that warrants being committed.  (The network_io_counters 
portion is a refactoring of what I initially attached to Issue 150.)

Original issue reported on code.google.com by jcscoob...@gmail.com on 21 Sep 2011 at 10:36

Attachments:

GoogleCodeExporter commented 9 years ago
Patch says "OSX_ONLY". As such, shouldn't it go into test/_osx.py rather than 
test/test_psutil.py?

Original comment by g.rodola on 22 Sep 2011 at 5:55

GoogleCodeExporter commented 9 years ago
Well, as I mentioned in the message it's really just an example implementation 
to get us thinking of a better way to do it.  If we're fine committing as-is 
but in the OS X specific test file, I can refactor and commit.  Originally, it 
was just meant to be a working example of how we might want to do it.  ;)

Take care,

Jeremy Whitlock <jcscoobyrs@gmail.com>
Twitter: jcscoobyrs
Website: http://www.thoughtspark.org

Original comment by jcscoob...@gmail.com on 22 Sep 2011 at 6:00

GoogleCodeExporter commented 9 years ago
Yes, sorry. I should read more carefully. =)

Original comment by g.rodola on 22 Sep 2011 at 6:02