使用Python监控App Engine中的CPU使用情况

时间:2011-10-31 09:11:45

标签: python google-app-engine quota

有没有办法在python中获取app引擎的当前cpu配额? (管理员控制台的仪表板屏幕中的CPU时间值)

提前谢谢

1 个答案:

答案 0 :(得分:2)

http://code.google.com/p/googleappengine/source/browse/trunk/python/google/appengine/api/quota.py

如果该课程有限,请使用trial and errorJython(慢)。

appears做你想做的事情,但是:

import logging
from google.appengine.api import quota

start = quota.get_request_cpu_usage()
do_something_expensive()
end = quota.get_request_cpu_usage()

logging.info("do_something_expensive() cost %d megacycles." % (end - start))

http://code.google.com/appengine/docs/quotas.html的新单独Python部分似乎尚未完成。

相关问题