Reputation: 2648
Is there any way to check Google App Engine Quota?I need to check Quota using Java Api. How can I do it?
Thank You.
Upvotes: 3
Views: 987
Reputation: 74134
Have a look to the com.google.appengine.api.quota package.
It provides the QuotaService interface (with an implementation and factory) with several methods to check and monitor Google App Engine quotas.
import com.google.appengine.api.quota.QuotaService;
import com.google.appengine.api.quota.QuotaServiceFactory;
...
QuotaService qs = QuotaServiceFactory.getQuotaService();
long start = qs.getCpuTimeInMegaCycles();
doSomethingExpensive();
long end = qs.getCpuTimeInMegaCycles();
double cpuSeconds = qs.convertMegacyclesToCpuSeconds(end - start);
Upvotes: 4