Measuring cache update latency
darrellburgan Oct 4, 2011 2:40 PMSorry 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:
{code:xml}
<global>
<transport
transportClass="org.infinispan.remoting.transport.jgroups.JGroupsTransport"
strictPeerToPeer="false"
distributedSyncTimeout="240000">
<properties>
<property name="configurationFile" value="infinispan/jgroups-production.xml" />
</properties>
</transport>
<asyncTransportExecutor>
<properties>
<property name="threadNamePrefix" value="peopleanswersAsyncTransportExecutor" />
<property name="maxThreads" value="100" />
</properties>
</asyncTransportExecutor>
</global>
<default>
<transaction
useEagerLocking="false"
syncCommitPhase="false"
syncRollbackPhase="false"
useSynchronization="false"
cacheStopTimeout="30000" />
<locking
useLockStriping="false"
isolationLevel="READ_COMMITTED"
concurrencyLevel="256"
lockAcquisitionTimeout="15000"
writeSkewCheck="false" />
<eviction
maxEntries="10000"
strategy="LIRS" />
<expiration
lifespan="-1"
maxIdle="14400000" />
</default>
<namedCache name="asyncInvalidationCache">
<clustering mode="invalidation">
<async
asyncMarshalling="false"
useReplQueue="false" />
<stateRetrieval fetchInMemoryState="false" />
</clustering>
</namedCache>
{code}
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