Refactors the regression test.

This commit is contained in:
Andrea Mazzoleni 2014-01-15 19:57:02 +01:00
parent 0f6867ba4e
commit 91c3de2182
6 changed files with 263 additions and 236 deletions

View file

@ -58,11 +58,11 @@ static int64_t diffgettimeofday(struct timeval *start, struct timeval *stop)
#define SPEED_STOP \
count += delta; \
gettimeofday(&stop, 0); \
} while (diffgettimeofday(&start, &stop) < 1000000LL); \
} while (diffgettimeofday(&start, &stop) < period * 1000LL); \
ds = size * (int64_t)count * nd; \
dt = diffgettimeofday(&start, &stop);
void speed(void)
void speed(int period)
{
struct timeval start;
struct timeval stop;
@ -74,7 +74,7 @@ void speed(void)
int id[RAID_PARITY_MAX];
int ip[RAID_PARITY_MAX];
int count;
int delta = 10;
int delta = period >= 1000 ? 10 : 1;
int size = TEST_SIZE;
int nd = 8;
int nv;