[ 
https://issues.apache.org/jira/browse/ARTEMIS-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16220621#comment-16220621
 ] 

ASF GitHub Bot commented on ARTEMIS-1476:
-----------------------------------------

Github user michaelandrepearce commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/1605#discussion_r147177663
  
    --- Diff: 
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/util/SyncCalculation.java
 ---
    @@ -55,32 +78,30 @@ public static long syncTest(File datafolder,
                                    int maxAIO,
                                    JournalType journalType) throws Exception {
           SequentialFileFactory factory = newFactory(datafolder, fsync, 
journalType, blockSize * blocks, maxAIO);
    +      final boolean asyncWrites = journalType == JournalType.ASYNCIO && 
!syncWrites;
    +      //the write latencies could be taken only when writes are 
effectively synchronous
    +      final Histogram writeLatencies = (verbose && !asyncWrites) ? new 
Histogram(MAX_FLUSH_NANOS, 2) : null;
     
           if (verbose) {
              System.out.println("Using " + factory.getClass().getName() + " to 
calculate sync times, alignment=" + factory.getAlignment());
           }
           SequentialFile file = factory.createSequentialFile(fileName);
    -
    +      //to be sure that a process/thread crash won't leave the dataFolder 
with garbage files
    +      file.getJavaFile().deleteOnExit();
           try {
    +         final ByteBuffer bufferBlock = allocateAlignedBlock(blockSize, 
factory);
    +
    +         final int alignedBlockSize = bufferBlock.remaining();
    +
              file.delete();
              file.open();
     
    -         file.fill(blockSize * blocks);
    +         file.fill(alignedBlockSize * blocks);
     
              file.close();
     
              long[] result = new long[tries];
     
    -         byte[] block = new byte[blockSize];
    --- End diff --
    
    Ignore, just noticed you moved this into allocateAlignedBlock


> HdrHistogram support on verbose SyncCalculation
> -----------------------------------------------
>
>                 Key: ARTEMIS-1476
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1476
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>
> The SyncCalculation::syncTest could benefit of 
> [HdrHistogram|http://hdrhistogram.org/] support to represent the write 
> latencies percentile distribution while using it as a CLI command (ie through 
> the perf-journal command).



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to