Class SessionMonitoringStore


  • @Singleton
    public class SessionMonitoringStore
    extends Object
    The store for session monitoring information. Each of the operations which can be applied to sessions (refresh, setProperty, destroy and logout) have their own store, which maps the session type (e.g. REMOTE or LOCAL) to the SessionMonitoringTimingStore. This timing store contains a (configurable) number of the most-recent SessionTimingEntry samples, which can be used to calculate e.g. the slowest, or average speed of a given operation. Uses an ExecutorService to perform writes out to the store (which may block).
    • Constructor Detail

      • SessionMonitoringStore

        @Inject
        public SessionMonitoringStore​(@Named("SESSION_MONITORING_EXECUTOR")
                                      ExecutorService executorService,
                                      SessionMonitoringTimingStoreFactory sessionMonitoringTimingStoreFactory)
        Guice-powered constructor, setting ourselves up with an executor service (which we will use to offload our monitoring writes). We generate a new synchronized map at construction time ready for monitoring data to be pushed in.
        Parameters:
        executorService - the service to which to offload out writes
    • Method Detail

      • storeRefreshTime

        public void storeRefreshTime​(long duration,
                                     SessionMonitorType type)
        Stores an entry in the refreshStore, offloading the work to another thread.
        Parameters:
        duration - the length of time the new entry represents
        type - the type of session to which this entry pertains
      • getAverageRefreshTime

        public long getAverageRefreshTime​(SessionMonitorType type)
        Gets the average value of entries in the refreshStore.
        Parameters:
        type - the type of session whose averages we are interested in
        Returns:
        the average duration (in nanoseconds)
      • storeSetPropertyTime

        public void storeSetPropertyTime​(long duration,
                                         SessionMonitorType type)
        Stores an entry in the propertyStore, offloading the work to another thread.
        Parameters:
        duration - the length of time the new entry represents
        type - the type of session to which this entry pertains
      • getAverageSetPropertyTime

        public long getAverageSetPropertyTime​(SessionMonitorType type)
        Gets the average value of entries in the propertyStore.
        Parameters:
        type - the type of session whose averages we are interested in
        Returns:
        the average duration (in nanoseconds)
      • storeDestroyTime

        public void storeDestroyTime​(long duration,
                                     SessionMonitorType type)
        Stores an entry in the destroyStore, offloading the work to another thread.
        Parameters:
        duration - the length of time the new entry represents
        type - the type of session to which this entry pertains
      • getAverageDestroyTime

        public long getAverageDestroyTime​(SessionMonitorType type)
        Gets the average value of entries in the destroyStore.
        Parameters:
        type - the type of session whose averages we are interested in
        Returns:
        the average duration (in nanoseconds)
      • storeLogoutTime

        public void storeLogoutTime​(long duration,
                                    SessionMonitorType type)
        Stores an entry in the logoutStore, offloading the work to another thread.
        Parameters:
        duration - the length of time the new entry represents
        type - the type of session to which this entry pertains
      • getAverageLogoutTime

        public long getAverageLogoutTime​(SessionMonitorType type)
        Gets the average value of entries in the logoutStore.
        Parameters:
        type - the type of session whose averages we are interested in
        Returns:
        the average duration (in nanoseconds)