#Dharunkumar Natarajan-metered

1 messages · Page 1 of 1 (latest)

foggy forgeBOT
fading forge
#

Hello! Starting up a thread for you

#

Dharunkumar Natarajan-metered

crisp wigeon
#

I am using aggregate_usage: sum but what if within the 5 minutes duration, my background jobs will not be able to complete the computations and report the usage? Any suggestions for this case?

fading forge
#

There isn't any good way to retroactively correct the usage of a billing cycle that has already passed/ended - the only other solution I could think of would be to shift the billing cycle to be a few mi nutes in the future (so that you report usage for midnight Oct 1 - midnight Nov 1, but the Stripe billing cycle is for somethig like 1 AM oct - 1 am Nov 1). Does that make sense?

crisp wigeon
#

that makes sense, but if the no.of customers signing up for my product increases, the background job will be taking more time to report the usage, in which case I would have to shift the billing cycle again?

fading forge
#

Instead of reporting usage all at the end, can you report usage in batches to minimize the amount of time it takes at the end of the period?

crisp wigeon
#

yeah, I am already doing that by reporting usage every 6 hours

#

but just thinking about the scalability

fading forge
#

Is the issue that you have to calcualte usage for all your subs at the start of the month? (I assume they all have the same billing cycle?)

crisp wigeon
#

Sorry for late reply, but to continue the conversation:

yeah right, all my customers will have the same billing cycle

fading forge
#

Yeah the only other thing I can think of is to have a large delay or maybe stagger your subscriptions so they don't end all at the exact same time