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

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

Github user franz1981 commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1605
  
    @clebertsuconic 
    > wouldn't be easier to keep all the original code and just add the 
Histogram.. without changing how callbacks are happening for example.. (The 
reason why you needed GCs).
    
    There are good reasons I can't do it and one is written below:
    > //it is necessary to allocate new callbacks because each async write has 
its own elapsed time
    ```
          final boolean asyncWrites = journalType == JournalType.ASYNCIO && 
!syncWrites;
          final Supplier<? extends SyncIOCompletion> ioCallbackFactory;
          if (asyncWrites) {
             //it is necessary to allocate new callbacks because each async 
write has its own elapsed time
             ioCallbackFactory = () -> new 
LatencyRecorderIOCallback(writeLatencies);
          } else {
             //i can reuse the same callback each time
             final ReusableIOCallback ioCallback = new 
ReusableIOCallback(writeLatencies);
             //uses will perform a countUp and reset start
             ioCallbackFactory = () -> {
                ioCallback.beforeWrite();
                return ioCallback;
             };
          }
    ```
    The others was related to compilation of methods by the JIT compiler if you 
have > 10000 writes and very fast storages/no fsync: you need to add 
`-XX:+PrintCompilation -XX:+UnlockDiagnosticVMOptions -XX:+PrintInlining` to 
the command line to find it.
    
    > if you are actually measuring 99%.. do you really need to take out GCs 
from the calculation?
    
    I'm providing all the percentiles offered by the HDR histogram and the GC 
is already taken out of the async measurements (if you have enough heap) by 
using the `awaitGC` method: it is already battle tested and defined in the 
official OpenJDK Java Microbenchmark Harness 
(http://openjdk.java.net/projects/code-tools/jmh/) 
[here](http://hg.openjdk.java.net/code-tools/jmh/file/cdac7ecd1392/jmh-core/src/main/java/org/openjdk/jmh/runner/BaseRunner.java#l310).
  
    
    IMO could be a good idea to provide this feature it is to drop at all the 
timeout calculation if a user want the latencies percentile and let the 
original calculation being used otherwise. I simply don't know how in what form 
expose such tool, @clebertsuconic @michaelandrepearce any idea?make sense?
    



> 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