Skip to main content

Momento Cache measures usage with operations

What is an operation?

An operation is a unit of work that reflects the utilization of networking and compute power. As a request consumes more resources, the operation count will increase proportionally.

The number of operations incurred by a request depends on two factors:

  • the size of user data transfered in the API call
  • the API called, plus any parameters that modify its behavior

Calculating operation cost of an API call

The base operation count for an API call is the number of 1024 byte chunks in each item or collection element transfered by the request and by the response. When a request or response contains no items or elements, the user-supplied data it contains is treated as a single item.

Each API has an operational complexity factor, as listed in the table below. The total operation count for an API call is the complexity factor multiplied by the base operation count.

All validly-authenticated API calls, including empty results or misconfigured requests, incur a minimum of 1 operation.

API Complexity Factors

This table defines the operational complexity factors for Momento Cache APIs. If an API is not listed below, its complexity factor is 1.

API NameComplexity Factor
SetIfAbsent2
SetIfPresent2
SetIfEqual2
SetIfNotEqual2
SetIfPresentAndNotEqual2
SetIfAbsentOrEqual2

API Parameter Modifiers

Some APIs may be modified by the ReadConcern parameter. When ReadConcern is set to Consistent, the operation cost is multiplied by an additional factor of 2.