use of org.forgerock.openam.cts.CTSOperation in project OpenAM by OpenRock.
the class TokenOperationsStoreTest method shouldGetMinimumOperationsPerPeriod.
@Test
public void shouldGetMinimumOperationsPerPeriod() {
//Given
CTSOperation operation = CTSOperation.CREATE;
given(operationStore.getMinRate(operation)).willReturn(1L);
//When
long result = tokenOperationsStore.getMinimumOperationsPerPeriod(operation);
//Then
assertEquals(result, 1L);
}
use of org.forgerock.openam.cts.CTSOperation in project OpenAM by OpenRock.
the class CtsCRUDOperationsPerTokenTypeEntryImpl method getDAverage.
/**
* Gets the average rate that the specified CTS operation, on the specified Token type has been made on the CTS.
*
* @return The average rate.
*/
@Override
public Long getDAverage() throws SnmpStatusException {
final TokenType tokenType = getTokenType();
final CTSOperation operation = getCTSOperation();
if (tokenType == null || operation == null) {
throw new InvalidSNMPQueryException();
}
return (long) monitoringStore.getAverageOperationsPerPeriod(getTokenType(), getCTSOperation());
}
Aggregations