繁体   English   中英

如何检查App Engine的配额?

[英]How to check App Engine's Quota?

有没有办法检查Google App Engine配额?我需要使用Java Api检查配额。 我该怎么做?

谢谢。

查看com.google.appengine.api.quota包。
它为QuotaService接口(带有实现和工厂)提供了几种检查和监控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);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM