1 Reply Latest reply on Oct 10, 2011 6:30 AM by Galder Zamarreño

    Measuring cache update latency

    Darrell Burgan Newbie

      Sorry if this is an obvious question, but I couldn't find an answer elsewhere in the forum or in the docs.


      I would like to measure in realtime how long it takes for cache updates (put() and remove()) to actually finish carrying out their synchronization operations with other nodes in the cluster. I know that I can easily measure this for synchronous operations by measuring the time it takes for the put() or remove() to return. But what about for asynchronous operations?


      For example, consider a cache configured thus:









                                              <property name="configurationFile" value="infinispan/jgroups-production.xml" />





                                    <property name="threadNamePrefix" value="peopleanswersAsyncTransportExecutor" />

                                    <property name="maxThreads" value="100" />










                          cacheStopTimeout="30000" />






                          writeSkewCheck="false" />



                          strategy="LIRS" />



                          maxIdle="14400000" />


      <namedCache name="asyncInvalidationCache">

                <clustering mode="invalidation">



                                    useReplQueue="false" />

                          <stateRetrieval fetchInMemoryState="false" />





      When my code calls put(), my understanding is that the cache class returns almost immediately after updating the local cache, and communication of the invalidation to all other caches happens in a background thread. But I would like to measure the time between the start of the initial call to put() all the way to the time that the final invalidation message is sent to the final node in the cluster.


      Note that we're currently using TCP/TCPGOSSIP communication in JGroups, if that matters.


      Also note that we are not using JTA transactioning at all, so Infinispan is using the DummyTransactionManager, if that is relevant.


      Is there some kind of way to measure this in Infinispan? Or is this an impossible task?


      Thanks for your help!


      Darrell Burgan