Quota Policy - What type it becomes when we remove Type = calendar from policy XML

sydub7
New Member

In Quota Policy template, the default type is "calendar". If we omit the type="calendar" and <StartTime> , does the type is now a rolling window or a flexi ?

The doc says : If you omit a type value, the default counter begins when the first request message is received from an app.

https://docs.apigee.com/api-services/reference/quota-policy#quotaattributes


If I understand correctly this behavior happens in both rolling window and flexi type?

Thanks in Advance.

Solved Solved
1 7 431
1 ACCEPTED SOLUTION

According to the docs, if you omit a type value, then you get the default quota behavior. There are four quota types:

  • default
  • rolling window
  • flexi
  • calendar

The "default" type of quota is not one of the other three. It's a separate thing.

With the default quota , the quota count resets at the top of the minute, hour, or day, etc.

5927-screenshot-20171114-155732.png

The behavior of rolling window and flexi quotas is described in the docs, too.

Try here: https://docs.apigee.com/api-services/reference/quota-policy#quotapolicytypes

Regarding this statement:

the default counter begins when the first request message is received from an app.

This statement could be clearer, I guess. In the simple case, there are two quantities that get tracked by the quota policy: the count of calls (which I guess you could call "a counter"), and the time the quota expires. Therefore it is not quite precise to say "the counter begins....", and there is no such thing as a "default counter". The counter just IS, and gets incremented when calls arrive, and gets reset when the reset time elapses.

With a default quota, the counter expires/resets at the top of the minute/hour/day, etc.

With calendar, it resets at a specific time.

With flexi, it resets after a specific interval AFTER the first request.

With rolling window, the counter more or less continuously resets. It's a lookback interval.

I hope this clarifies.

View solution in original post

7 REPLIES 7

According to the docs, if you omit a type value, then you get the default quota behavior. There are four quota types:

  • default
  • rolling window
  • flexi
  • calendar

The "default" type of quota is not one of the other three. It's a separate thing.

With the default quota , the quota count resets at the top of the minute, hour, or day, etc.

5927-screenshot-20171114-155732.png

The behavior of rolling window and flexi quotas is described in the docs, too.

Try here: https://docs.apigee.com/api-services/reference/quota-policy#quotapolicytypes

Regarding this statement:

the default counter begins when the first request message is received from an app.

This statement could be clearer, I guess. In the simple case, there are two quantities that get tracked by the quota policy: the count of calls (which I guess you could call "a counter"), and the time the quota expires. Therefore it is not quite precise to say "the counter begins....", and there is no such thing as a "default counter". The counter just IS, and gets incremented when calls arrive, and gets reset when the reset time elapses.

With a default quota, the counter expires/resets at the top of the minute/hour/day, etc.

With calendar, it resets at a specific time.

With flexi, it resets after a specific interval AFTER the first request.

With rolling window, the counter more or less continuously resets. It's a lookback interval.

I hope this clarifies.

Many thanks @Dino for the information and clarifications you provided. I still have a little doubt which I'll try to explain :

Suppose I have 2 Quota Policies. The first is Default & second is Flexi. For both policies the Interval is set as 1 and TimeUnit is set as Minute.

if a request comes in at 9:00 AM on First (Default) the Quota resets on 9:01 AM
if a request comes in at 9:00 AM on Second (Flexi) the Quota resets on 9:01 AM

So what is the differentiating factor between two ?

Thanks Again.

PS : I am absolutely clear about Rolling Window & Calendar type

Well there's no difference in the behavior of the respective quota policies in your scenario, comparing flexi with default. The key in your scenario is that the first request arrives at the beginning of the counting window for the default quota - ie: at exactly 9:00:00.

But suppose that is not the case. Suppose the first request to each comes in at 9:00:34. The default quota resets the counter at 9:01:00. The flexi resets the counter at 9:01:34 .

Do you see?

Perfect !!! I see that and with absolute clarity now .. Thanks for explaining with an example.

When we update a quota policy from 
Quota : 1000 , Interval : 1 , TimeUnit : day    
TO 
Quota:1,000,000 , Interval : 30 , TimeUnit : day

Do both flexi and default look back 30 days and  substract the used quota form the available 1,000,000 until the next 30 days ? 

Thank you so much for the help . 

The documentation doesn't describe what happens "when you update" a quota policy configuration. But  I think "when you update", it's a new quota configuration and it starts counting THEN .  It doesn't "look back".  

Thank you !