Class CTSMonitoringStoreImpl

    • Field Detail

      • EXECUTOR_BINDING_NAME

        public static final String EXECUTOR_BINDING_NAME
        Constant for binding an Executor for the CTS monitoring store to store CTS runtime data.
        See Also:
        Constant Field Values
    • Constructor Detail

      • CTSMonitoringStoreImpl

        @Inject
        public CTSMonitoringStoreImpl​(@Named("MONITORING_EXECUTOR")
                                      ExecutorService executorService,
                                      TokenOperationsStore tokenOperationsStore,
                                      ReaperMonitor reaperMonitor,
                                      ConnectionStore connectionStore,
                                      @Named("amCoreTokenService")
                                      Debug debug)
        Constructs an instance of the CTSMonitoringStoreImpl.
        Parameters:
        debug - An instance of the debug logger.
        executorService - An instance of an ExecutorService.
        tokenOperationsStore - An instance of the TokenOperationsStore.
        reaperMonitor - An instance of the ReaperMonitor.
    • Method Detail

      • addTokenOperation

        public void addTokenOperation​(Token token,
                                      CTSOperation operation,
                                      boolean success)
        Adds a Token operation into the monitoring store.
        The operation is mapped to the type of the token. The operations per configurable period and cumulative count will be updated for the token type and operation.
        Passing in null as the token will mean that the operation is not mapped to a particular token type, this is for operations such as delete and list as the type of token cannot be determined. The operations per configurable period and cumulative count will be updated for the operation.
        Specified by:
        addTokenOperation in interface CTSOperationsMonitoringStore
        Parameters:
        token - The Token the operation was performed on.
        operation - The operation performed.
        success - Whether the operation was successful or not.
      • getAverageOperationsPerPeriod

        public double getAverageOperationsPerPeriod​(TokenType type,
                                                    CTSOperation operation)
        Gets the average rate of operations made in a given period.
        Will return the number of the specified operation made on the specified type token in a given (configurable) period.
        Passing in null as the operation will mean that the method will return the number of the specified operation made on tokens, which the type cannot be determined, i.e. Delete and List operations.
        Specified by:
        getAverageOperationsPerPeriod in interface CTSOperationsMonitoringStore
        Parameters:
        type - The type of token to get the operation average rate for.
        operation - The operation to get the average rate for.
        Returns:
        The average number of operations made on the type token in a given period.
      • getMinimumOperationsPerPeriod

        public long getMinimumOperationsPerPeriod​(TokenType type,
                                                  CTSOperation operation)
        Gets the minimum rate of operations made in a given period.
        Will return the number of the specified operation made on the specified type token in a given (configurable) period.
        Passing in null as the operation will mean that the method will return the number of the specified operation made on tokens, which the type cannot be determined, i.e. Delete and List operations.
        Specified by:
        getMinimumOperationsPerPeriod in interface CTSOperationsMonitoringStore
        Parameters:
        type - The type of token to get the operation minimum rate for.
        operation - The operation to get the minimum rate for.
        Returns:
        The minimum number of operations made on the type token in a given period.
      • getMaximumOperationsPerPeriod

        public long getMaximumOperationsPerPeriod​(TokenType type,
                                                  CTSOperation operation)
        Gets the maximum rate of operations made in a given period.
        Will return the number of the specified operation made on the specified type token in a given (configurable) period.
        Passing in null as the operation will mean that the method will return the number of the specified operation made on tokens, which the type cannot be determined, i.e. Delete and List operations.
        Specified by:
        getMaximumOperationsPerPeriod in interface CTSOperationsMonitoringStore
        Parameters:
        type - The type of token to get the operation maximum rate for.
        operation - The operation to get the maximum rate for.
        Returns:
        The maximum number of operations made on the type token in a given period.
      • getOperationsCumulativeCount

        public long getOperationsCumulativeCount​(TokenType type,
                                                 CTSOperation operation)
        Gets the cumulative count of operations made since server start up.
        Will return the total number of the specified operation made on the specified type of token since the server stared.
        Passing in null as the operation will mean that the method will return the total number of the specified operation made on tokens, which the type cannot be determined, i.e. Delete and List operations.
        Specified by:
        getOperationsCumulativeCount in interface CTSOperationsMonitoringStore
        Parameters:
        type - The type of token to get the cumulative count for.
        operation - The operation to get the cumulative count for.
        Returns:
        The total number of operations made on the type of token since server start up.
      • getOperationFailuresCumulativeCount

        public long getOperationFailuresCumulativeCount​(CTSOperation operation)
        Gets the cumulative count of failures of this operation type since server startup.
        Note that failure counts are not distinguished by token type as in most failure cases this information is not available. Uses the TokenOperationsStore to return the cumulative failure count.
        Specified by:
        getOperationFailuresCumulativeCount in interface CTSOperationsMonitoringStore
        Parameters:
        operation - The operation to get the failure count for.
        Returns:
        The total number of failed operations of this type since server startup.
      • getMinimumOperationFailuresPerPeriod

        public long getMinimumOperationFailuresPerPeriod​(CTSOperation operation)
        Description copied from interface: CTSOperationsMonitoringStore
        Gets the minimum observed failure rate for the given operation in the current period.
        Specified by:
        getMinimumOperationFailuresPerPeriod in interface CTSOperationsMonitoringStore
        Parameters:
        operation - the operation to get the failure rate for.
        Returns:
        the minimum observed failure rate of the given operation in the current monitoring period.
      • getMaximumOperationFailuresPerPeriod

        public long getMaximumOperationFailuresPerPeriod​(CTSOperation operation)
        Description copied from interface: CTSOperationsMonitoringStore
        Gets the maximum observed failure rate for the given operation in the current period.
        Specified by:
        getMaximumOperationFailuresPerPeriod in interface CTSOperationsMonitoringStore
        Parameters:
        operation - the operation to get the failure rate for.
        Returns:
        the maximum observed failure rate of the given operation in the current monitoring period.
      • addReaperRun

        public void addReaperRun​(long startTime,
                                 long runTime,
                                 long numberOfDeletedSessions)
        Adds a CTS Reaper run to the monitoring store.
        Specified by:
        addReaperRun in interface CTSReaperMonitoringStore
        Parameters:
        startTime - The start time of the reaper run.
        runTime - The end time of the reaper run.
        numberOfDeletedSessions - The total number of deleted sessions.
      • getRateOfDeletedSessions

        public double getRateOfDeletedSessions()
        Gets the average rate of deletion based from all of the reaper runs since server start up.
        Specified by:
        getRateOfDeletedSessions in interface CTSReaperMonitoringStore
        Returns:
        The rate of session deletion by the CTS Reaper.
      • addConnection

        public void addConnection​(boolean success)
        Description copied from interface: CTSConnectionMonitoringStore
        Adds a connection attempt event into the monitoring store.
        Specified by:
        addConnection in interface CTSConnectionMonitoringStore
        Parameters:
        success - True to increment number of successful connections made through this pool, false for failure
      • getAverageConnectionsPerPeriod

        public double getAverageConnectionsPerPeriod​(boolean success)
        Description copied from interface: CTSConnectionMonitoringStore
        Gets the average number of connections requested from the pool in a given interval.
        Specified by:
        getAverageConnectionsPerPeriod in interface CTSConnectionMonitoringStore
        Parameters:
        success - True to get average number of successful connections, false for average number of connection requests rejected
        Returns:
        The average number of connections in a given period.
      • getMinimumOperationsPerPeriod

        public double getMinimumOperationsPerPeriod​(boolean success)
        Description copied from interface: CTSConnectionMonitoringStore
        Gets the minimum number of connections requested from the pool in a given interval.
        Specified by:
        getMinimumOperationsPerPeriod in interface CTSConnectionMonitoringStore
        Parameters:
        success - True to get minimum number of successful connections, false for minimum number of connection requests rejected
        Returns:
        The minimum number of connections in a given period.
      • getMaximumOperationsPerPeriod

        public double getMaximumOperationsPerPeriod​(boolean success)
        Description copied from interface: CTSConnectionMonitoringStore
        Gets the maximum number of connections requested from the pool in a given interval.
        Specified by:
        getMaximumOperationsPerPeriod in interface CTSConnectionMonitoringStore
        Parameters:
        success - True to get maximum number of successful connections, false for maximum number of connection requests rejected
        Returns:
        The maximum number of connections in a given period.
      • getConnectionsCumulativeCount

        public double getConnectionsCumulativeCount​(boolean success)
        Description copied from interface: CTSConnectionMonitoringStore
        Gets the total count of connections requested from the pool in a given interval.
        Specified by:
        getConnectionsCumulativeCount in interface CTSConnectionMonitoringStore
        Parameters:
        success - True to get total count of successful connections, false for total count of connection requests rejected
        Returns:
        The total count of connections in a given period.