stat: stop triggerring division by zero on bandwidth lower than 1KBps
authorsribs <sriharsha.bs@outlook.com>
Fri, 24 Jul 2020 16:53:50 +0000 (22:23 +0530)
committersribs <sriharsha.bs@outlook.com>
Fri, 24 Jul 2020 16:53:50 +0000 (22:23 +0530)
commit5c0abd5e21df3b0ca7ee0833eb0ddf3f87ad4374
tree62eaeaa4e8873859d25d80437275042eb7d4e893
parentdf06a03616661423baa39b68a8679c7f7baa99ed
stat: stop triggerring division by zero on bandwidth lower than 1KBps

Before the integer arithmetic is performed to obtain
percentage of aggregation this conversion of rs->agg[ddir] into KBytes
could potentially turn out to be 0.

Adjust stat.c to no longer trigger division by zero on bandwidths
greater than 0 but less than 1kilobyte a second. The fact that this
is performed on multiple occasions, a function is preferred

Signed-off-by: sribs <sribs@microsoft.com>
stat.c