Skip to content

Streamline QuotaDescriptor. #35

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 31, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 4 additions & 19 deletions mixer/v1/config/descriptor/quota_descriptor.proto
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,8 @@ message QuotaDescriptor {
// The default imposed maximum amount for values of this quota.
int64 max_amount = 6;

// The type of quota behavior expected, defaults to ALLOCATION_LIMIT if not specified
QuotaKind kind = 7;

// Whether the quota's current value is tracked precisely or not.
// Precisely tracked quotas only allow a relatively modest level of
// scaling, whereas imprecise quotas can support a nearly unbounded
// level of scaling at the cost of potential accounting inaccuracies.
bool precise = 8;

enum QuotaKind {
// Quota values are always explicitly manipulated via API calls.
ALLOCATION_LIMIT = 0;

// Quota limit expresses a maximum amount over a rolling time interval
PER_SECOND_LIMIT = 1;

// Quota limit expresses a maximum amount over a rolling time interval
PER_MINUTE_LIMIT = 2;
}
// The amount of time allocated quota remains valid before it is
// automatically released. If this is 0, then allocated quota is
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we happy using 0 as opposed to a wrapped value?

// not automatically released.
int32 expiration_seconds = 7;
}
17 changes: 2 additions & 15 deletions mixer/v1/quota.proto
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ message QuotaRequest {
// The attributes to use for this request
Attributes attribute_update = 2;

// what kind of quota operation to perform
OperationKind kind = 3;

// Used for deduplicating quota allocation/free calls in the case of
// failed RPCs and retries. This should be a UUID per call, where the same
// UUID is used for retries of the same quota allocation or release call.
Expand All @@ -45,9 +42,6 @@ message QuotaRequest {

// Release from 0 to the specified amount, never fails.
RELEASE_BEST_EFFORT = 3;

// Return the current content of the quota value cell.
QUERY = 4;
}
}

Expand All @@ -60,13 +54,6 @@ message QuotaResponse {
// Index of the request this response is associated with
int64 request_index = 1;

// Results, one for each operation in the request.
// This map is indexed by the quota_operation_id of the individual quota operations.
oneof result {
// The effective amount of quota
uint64 effective_amount = 2;

// An error indication in case the quota operation failed
google.rpc.Status error = 3;
}
// Indicates whether or not the quota operation succeeded.
google.rpc.Status result = 2;
}