如何检查App Engine的配额? [英] How to check App Engine's Quota?

查看:129
本文介绍了如何检查App Engine的配额?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法检查Google App Engine的配额?我需要使用Java Api来检查配额。

Is there any way to check Google App Engine Quota?I need to check Quota using Java Api. How can I do it?

谢谢。

推荐答案

有查看 com .google.appengine.api.quota 包。

它提供了QuotaService接口(包含实现和工厂),并提供了多种方法来检查和监控Google App Engine配额。

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);

这篇关于如何检查App Engine的配额?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆