Rework diff numbers

This commit is contained in:
Mark Nellemann 2022-11-11 15:14:26 +01:00
parent 07de3cb84e
commit d726bc1982

16
main.c
View file

@ -90,19 +90,19 @@ int main(int argc, char* argv[]) {
} }
unsigned long drbytes = 0; unsigned long drbytes = 0;
if(history[i][1] > 0) { if(history[i][0] > 0) {
drbytes = rbytes - history[i][1]; drbytes = rbytes - (history[i][0] * bsize);
} }
unsigned long dwblbks = 0; unsigned long dwblbks = 0;
if (history[i][2] > 0) { if (history[i][1] > 0) {
dwblbks = wblks - history[i][2]; dwblbks = wblks - history[i][1];
} }
unsigned long dwbytes = 0; unsigned long dwbytes = 0;
if(history[i][3] > 0) { if(history[i][1] > 0) {
dwbytes = wbytes - history[i][3]; dwbytes = wbytes - (history[i][1] * bsize);
} }
@ -119,9 +119,7 @@ int main(int argc, char* argv[]) {
dwbytes); dwbytes);
history[i][0] = rblks; history[i][0] = rblks;
history[i][1] = rbytes; history[i][1] = wblks;
history[i][2] = wblks;
history[i][3] = wbytes;
} }
sleep(10); sleep(10);