Skip to main content
 首页 » 编程设计

python之GAE/P : Testbed stub for runtime. 内存使用情况

2025年05月04日12davidwang456

我刚刚了解到您可以在 App Engine 中执行此操作以获取您的实例内存使用情况:

from google.appengine.api.runtime import memory_usage 
memory_usage().current() 

这很酷,但是当我运行测试时,我得到这个错误:

File ".../google-cloud-sdk/platform/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 322, in MakeSyncCall assert stub, 'No api proxy found for service "%s"' % service AssertionError: No api proxy found for service "system"

testbed 中有这个 stub 吗?没有 init_system_stub。

请您参考如下方法:

根据这个wonky GAE reference guide ,看起来 google.appengine.api.runtime 自版本 1.8.1 以来已被弃用。根据the SDK Release notes , 版本 1.8.1 已经两年多了。谷歌可能刚刚放弃了对它的支持。

不过,如果他们先发出运行时警告就好了。