Bug 1461221 - Account for psutil.disk_io_counters() returning None; r=mshal
authorGregory Szorc <gps@mozilla.com>
Tue, 15 May 2018 12:02:46 -0700
changeset 418400 e4ce7b97291627f2186dc23be0dadd3c56dfe938
parent 418399 f288a2c9c4390898a17ad9f964218b52b87d8028
child 418401 f093c57bcc024ad7fbc29b1d00f8352643bfea19
push id34000
push userebalazs@mozilla.com
push dateWed, 16 May 2018 09:59:58 +0000
treeherdermozilla-central@dedd25bfd279 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmshal
bugs1461221
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1461221 - Account for psutil.disk_io_counters() returning None; r=mshal Apparently it can do this. MozReview-Commit-ID: 6gMTGtcRAw6
testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
--- a/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
+++ b/testing/mozbase/mozsystemmonitor/mozsystemmonitor/resourcemonitor.py
@@ -60,16 +60,19 @@ except Exception:
         psutil = None
 
     have_psutil = False
 
 
 def get_disk_io_counters():
     try:
         io_counters = psutil.disk_io_counters()
+
+        if io_counters is None:
+            return PsutilStub().disk_io_counters()
     except RuntimeError:
         io_counters = PsutilStub().disk_io_counters()
 
     return io_counters
 
 
 def _collect(pipe, poll_interval):
     """Collects system metrics.