Package com.github.ambry.quota
Interface RequestCostPolicy
-
public interface RequestCostPolicy
Interface to define the policy to calculate cost of a request. This can be used for quota enforcement or cost to serve type calculations.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.lang.Double>
calculateRequestCost(RestRequest restRequest, RestResponseChannel responseChannel, BlobInfo blobInfo)
Calculates the cost incurred to serve the specifiedRestRequest
for blob specified byBlobInfo
-
-
-
Method Detail
-
calculateRequestCost
java.util.Map<java.lang.String,java.lang.Double> calculateRequestCost(RestRequest restRequest, RestResponseChannel responseChannel, BlobInfo blobInfo)
Calculates the cost incurred to serve the specifiedRestRequest
for blob specified byBlobInfo
- Parameters:
restRequest
-RestRequest
served.responseChannel
-RestResponseChannel
object.blobInfo
-BlobInfo
of the blob in request.- Returns:
- Map of cost metrics and actual cost value.
-
-