quota : cpuの使用量をチェック | google app engine

cpuは課金してみようと思います。

CPUの利用量がわかるらしいのでやってみます。
quota.pyとして置いてみました。

関数の前後で数字を取得して、差分をチェックしている例。

http://code.google.com/intl/ja/appengine/docs/quotas.html#Per-minute_Quotas

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." % (start - end))

This entry was posted on 月曜日, 5月 9th, 2011 at 6:59 PM and is filed under blog, Google App Engine, Python. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Unityによるゲームを公開しております iOS/Android
https://itunes.apple.com/jp/app/lost-knight-3d-action/id900917032
https://play.google.com/store/apps/details?id=com.groundroad.runknight

各種開発支援・機能開発等小さいお仕事などもお請けしております。
unity開発支援, PHPシステム開発, javascript/html5 フロント開発, titanium mobileアプリ開発
お気軽にお問い合わせください
大崎・五反田近郊での対面でのお打ち合わせはいつでも可能です。