Skip to content
Permalink
Browse files

add benchmark to consistency test

  • Loading branch information...
joshbooks committed May 2, 2019
1 parent f5ac2de commit 0e95612e12792df0457d9cd4414922a59f5af140
Showing with 19 additions and 1 deletion.
  1. +19 −1 test/src/org/josh/JoshDB/FileTrie/ConsistencyTest.java
@@ -439,7 +439,7 @@ public void testReadWriteMetadataConsistency()

for (int i = 0; i < testArray.length; i++)
{
testArray[i] = new byte[random.nextInt(0x10000)];
testArray[i] = new byte[0x10000];
random.nextBytes(testArray[i]);
}

@@ -505,6 +505,8 @@ public void testReadWriteMetadataConsistency()
readSucesses[i] = false;
}

long startTime = System.nanoTime();

startAndJoinThreads
(
testArray.length,
@@ -572,6 +574,22 @@ public void testReadWriteMetadataConsistency()
}
);

long endTime = System.nanoTime();

System
.out
.println
(
"It took "
+ (endTime - startTime)
+ " nanoseconds"
+ " to read "
+ testArray.length
+ " objects, each "
+ testArray[0].length
+ " bytes long"
);

boolean globalSuccess = true;
for (int i = 0; i < readSucesses.length; i++)
{

0 comments on commit 0e95612

Please sign in to comment.
You can’t perform that action at this time.