3 Replies Latest reply on Jan 19, 2006 7:56 PM by Jerry Gauthier

    JBCACHE-56 - measuring average read and write times

    Jerry Gauthier Apprentice

      JBCACHE-56 introduces a new interceptor to capture cache statistics. This interceptor executes after the other interceptors so that it captures end results (e.g., hits, misses, stores) after all interceptors have run.

      This interceptor location doesn't work well for measuring read and write times as it occurs after most of the work has been performed by other interceptors (e.g., tx, replication). In order to provide meaningful read and write times, it's necessary to measure this data elsewhere. The information can still be exposed through this statistics interceptor but it can't be measured here as the normal result is 0 ms.

      There are several possible locations where this information can be captured.

      1) In TreeCache itself (e.g., in appropriate _put methods). This is the most accurate location but requires that we add more logic and methods to TreeCache.

      2) In the "first" interceptor in the stack. Right now, this is the TxInterceptor. This would work properly and wouldn't require the use of a new interceptor but it would be subject to future rework if another interceptor was located first. It would probably be possible to make this configurable at the expense of some work in the InterceptorFactory.

      3) Introduce a new interceptor into the stack for this purpose. This interceptor would execute first so that it would measue the elapsed time of all processing from the other interceptors. This is probably the cleanest alternative but it requires another interceptor, theoretically adding time to the cache process.

      My currrent inclination is to go with the new interceptor. Other opinions?