public class SyncCalculation extends Object
Constructor and Description |
---|
SyncCalculation() |
Modifier and Type | Method and Description |
---|---|
static long |
syncTest(File datafolder,
int blockSize,
int blocks,
int tries,
boolean verbose,
boolean fsync,
boolean syncWrites,
String fileName,
int maxAIO,
JournalType journalType)
It will perform
tries write tests of blockSize * blocks bytes and returning the lowest elapsed time to perform a try. |
static long |
toNanos(long time,
long blocks,
boolean verbose) |
public static long syncTest(File datafolder, int blockSize, int blocks, int tries, boolean verbose, boolean fsync, boolean syncWrites, String fileName, int maxAIO, JournalType journalType) throws Exception
tries
write tests of blockSize * blocks
bytes and returning the lowest elapsed time to perform a try.
Please configure blocks >= -XX:CompileThreshold
(ie by default on most JVMs is 10000) to favour the best JIT/OSR compilation (ie: Just In Time/On Stack Replacement)
if the test is running on a temporary file-system (eg: tmpfs on Linux) or without fsync
.
NOTE: The write latencies are provided only if verbose && !(journalType == JournalType.ASYNCIO && !syncWrites)
(ie are used effective synchronous writes).
datafolder
- the folder where the journal files will be storedblockSize
- the size in bytes of each write on the journalblocks
- the number of blockSize
writes performed on each trytries
- the number of testsverbose
- true
to make the output verbose, false
otherwisefsync
- if true
the test is performing full durable writes, false
otherwisesyncWrites
- if true
each write is performed only if the previous one is completed, false
otherwise (ie each try will wait only the last write)fileName
- the name of the journal file used for the testmaxAIO
- the max number of in-flight IO requests (if journalType
will support it)journalType
- the JournalType
used for the testsTimeUnit.MILLISECONDS
) to perform a tryException
public static long toNanos(long time, long blocks, boolean verbose)
Copyright © 2021 JBoss by Red Hat. All rights reserved.