Class SyncCalculation
java.lang.Object
org.apache.activemq.artemis.cli.commands.util.SyncCalculation
It will perform a simple test to evaluate how many syncs a disk can make per second
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic longsyncTest(File datafolder, int blockSize, int blocks, int tries, boolean verbose, boolean fsync, boolean syncWrites, String fileName, int maxAIO, JournalType journalType, ActionContext context) It will performtrieswrite tests ofblockSize * blocksbytes and returning the lowest elapsed time to perform a trystatic longtoNanos(long time, long blocks, boolean verbose, ActionContext context)
-
Constructor Details
-
SyncCalculation
public SyncCalculation()
-
-
Method Details
-
syncTest
public static long syncTest(File datafolder, int blockSize, int blocks, int tries, boolean verbose, boolean fsync, boolean syncWrites, String fileName, int maxAIO, JournalType journalType, ActionContext context) throws Exception It will performtrieswrite tests ofblockSize * blocksbytes 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 withoutfsync.NOTE: The write latencies are provided only if
verbose && !(journalType == JournalType.ASYNCIO && !syncWrites)(ie are used effective synchronous writes).- Parameters:
datafolder- the folder where the journal files will be storedblockSize- the size in bytes of each write on the journalblocks- the number ofblockSizewrites performed on each trytries- the number of testsverbose-trueto make the output verbose,falseotherwisefsync- iftruethe test is performing full durable writes,falseotherwisesyncWrites- iftrueeach write is performed only if the previous one is completed,falseotherwise (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 (ifjournalTypewill support it)journalType- theJournalTypeused for the tests- Returns:
- the lowest elapsed time (in
TimeUnit.MILLISECONDS) to perform a try - Throws:
Exception
-
toNanos
-