Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Check that diff is not negative

  • Loading branch information...
commit 133c19518dcc4486e878829d5a9a361e09a11216 1 parent bbf8cf3
@vvuksan vvuksan authored
Showing with 6 additions and 0 deletions.
  1. +6 −0 diskstat/python_modules/diskstat.py
View
6 diskstat/python_modules/diskstat.py
@@ -342,6 +342,12 @@ def get_diff(dev, key, val, convert=1):
else:
stats[dev][key] = 0
+ # If for some reason we have a negative diff we should assume counters reset
+ # and should set it back to 0
+ if stats[dev][key] < 0:
+ stats[dev][key] = 0
+
+
last_val[dev][key] = val
def get_stat(name):
Please sign in to comment.
Something went wrong with that request. Please try again.