Skip to content

Commit

Permalink
fix calculation of output and input data rate
Browse files Browse the repository at this point in the history
  • Loading branch information
smorovic committed Mar 14, 2016
1 parent 5a5a550 commit a1d780c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/SystemMonitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -585,10 +585,11 @@ def getRatesMBs(self,silent=True):
self.ifs_out = sum_out
return [0,0,new_time-old_time]
else:
divisor = 1. / (delta_t*1024*1024.)
delta_in = (sum_in - self.ifs_in) * divisor # Bytes/ms >> 10 == MB/s
delta_out = (sum_out - self.ifs_out) * divisor
self.ifs_in = sum_in
self.ifs_out = sum_out
delta_in = ((sum_in - self.ifs_in) / delta_t) / (1024*1024) # Bytes/ms >> 10 == MB/s
delta_out = ((sum_out - self.ifs_out) / delta_t) /(1024*1024)
return [delta_in,delta_out,new_time-old_time]
except Exception as ex:
if not silent:
Expand Down

0 comments on commit a1d780c

Please sign in to comment.