有什么方法可以检查 Google App Engine 配额吗?我需要使用 Java Api 检查配额。我该怎么做?
谢谢。
最佳答案
查看 com.google.appengine.api.quota包裹。
它为 QuotaService 接口(interface)(带有实现和工厂)提供了多种检查和监控 Google App Engine 配额的方法。
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);
关于java - 如何查看 App Engine 的配额?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5229597/