Class TokenOperationsStore
- java.lang.Object
-
- org.forgerock.openam.cts.monitoring.impl.operations.TokenOperationsStore
-
@Singleton public class TokenOperationsStore extends Object
An internal data structure for the CTSOperationsMonitoringStore to store monitoring information about operations of tokens.
The token operation monitoring information is split per token type and both a cumulative count and rate is calculated and maintained.- Since:
- 12.0.0
-
-
Constructor Summary
Constructors Constructor Description TokenOperationsStore()Constructs a new instance of the TokenOperationsStore.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddTokenOperation(CTSOperation operation, boolean success)Adds a Token operation into the monitoring store.voidaddTokenOperation(TokenType type, CTSOperation operation, boolean success)Adds a Token operation into the monitoring store.doublegetAverageOperationFailuresPerPeriod(CTSOperation operation)Gets the average (mean) rate of operation failures in the current collection period for all token types.doublegetAverageOperationsPerPeriod(CTSOperation operation)Gets the average rate of operations made in a given period.doublegetAverageOperationsPerPeriod(TokenType type, CTSOperation operation)Gets the average rate of operations made in a given period.longgetMaximumOperationFailuresPerPeriod(CTSOperation operation)Gets the maximum observed failure rate of an operation in the current period.longgetMaximumOperationsPerPeriod(CTSOperation operation)Gets the maximum rate of operations made in a given period.longgetMaximumOperationsPerPeriod(TokenType type, CTSOperation operation)Gets the maximum rate of operations made in a given period.longgetMinimumOperationFailuresPerPeriod(CTSOperation operation)Gets the minimum rate of operation failures seen in the current collection period.longgetMinimumOperationsPerPeriod(CTSOperation operation)Gets the minimum rate of operations made in a given period.longgetMinimumOperationsPerPeriod(TokenType type, CTSOperation operation)Gets the minimum rate of operations made in a given period.longgetOperationFailuresCumulativeCount(CTSOperation operation)Gets the cumulative count of failures of this operation since server startup.longgetOperationsCumulativeCount(CTSOperation operation)Gets the cumulative count of operations made since server start up.longgetOperationsCumulativeCount(TokenType type, CTSOperation operation)Gets the cumulative count of operations made since server start up.
-
-
-
Method Detail
-
addTokenOperation
public void addTokenOperation(TokenType type, 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.- Parameters:
type- The type of token the operation was performed on.operation- The operation performed.success- Whether the operation was successful or not.
-
addTokenOperation
public void addTokenOperation(CTSOperation operation, boolean success)
Adds a Token operation into the monitoring store.
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.- Parameters:
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.- Parameters:
type- The type of token to now the operation average rate for.operation- The operation to now 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.- Parameters:
type- The type of token to now the operation rate for.operation- The operation to now 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.- Parameters:
type- The type of token to now the operation maximum rate for.operation- The operation to now the maximum rate for.- Returns:
- The maximum number of operations made on the type token in a given period.
-
getAverageOperationsPerPeriod
public double getAverageOperationsPerPeriod(CTSOperation operation)
Gets the average rate of operations made in a given period.
Returns the overall rate of calls to the given operation for all token types.- Parameters:
operation- The operation to now the average rate for.- Returns:
- The average number of operations made in a given period.
-
getAverageOperationFailuresPerPeriod
public double getAverageOperationFailuresPerPeriod(CTSOperation operation)
Gets the average (mean) rate of operation failures in the current collection period for all token types.- Parameters:
operation- the operation to get an average failure rate for.- Returns:
- the average operation failure rate for this operation for all token types.
-
getMinimumOperationsPerPeriod
public long getMinimumOperationsPerPeriod(CTSOperation operation)
Gets the minimum rate of operations made in a given period.
Will return the number of the specified operation made on tokens, which the type cannot be determined, i.e. Delete and List operations.- Parameters:
operation- The operation to now the minimum rate for.- Returns:
- The minimum number of operations made in a given period.
-
getMinimumOperationFailuresPerPeriod
public long getMinimumOperationFailuresPerPeriod(CTSOperation operation)
Gets the minimum rate of operation failures seen in the current collection period.- Parameters:
operation- the operation to get the minimum failure rate for.- Returns:
- the minimum observed failure rate for the given operation.
-
getMaximumOperationsPerPeriod
public long getMaximumOperationsPerPeriod(CTSOperation operation)
Gets the maximum rate of operations made in a given period.
Will return the number of the specified operation made on tokens, which the type cannot be determined, i.e. Delete and List operations.- Parameters:
operation- The operation to now the maximum rate for.- Returns:
- The maximum number of operations made in a given period.
-
getMaximumOperationFailuresPerPeriod
public long getMaximumOperationFailuresPerPeriod(CTSOperation operation)
Gets the maximum observed failure rate of an operation in the current period.- Parameters:
operation- the operation to get the maximum failure rate for.- Returns:
- the maximum observed failure rate for the given operation.
-
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.- Parameters:
type- The type of token to now the cumulative count for.operation- The operation to now the cumulative count for.- Returns:
- The total number of operations made on the type of token since server start up.
-
getOperationsCumulativeCount
public long getOperationsCumulativeCount(CTSOperation operation)
Gets the cumulative count of operations made since server start up.
Will return the total number of the specified operation made on tokens, which the type cannot be determined, i.e. Delete and List operations.- Parameters:
operation- The operation to know the cumulative count for.- Returns:
- The total number of operations made since server start up.
-
getOperationFailuresCumulativeCount
public long getOperationFailuresCumulativeCount(CTSOperation operation)
Gets the cumulative count of failures of this operation since server startup.- Parameters:
operation- The operation to get the cumulative failure count for.- Returns:
- The total number of failures of this operation since server startup.
-
-