2015-11-07 15 views
2

我剛剛得知你可以在App Engine上做到這一點,讓您的實例內存使用情況:GAE/P:runtime.memory_usage的測試樁存根?

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"

在測試平臺中是否存在這個存根?沒有init_system_stub

+0

我只是在升級GAE後大肆宣傳。也許是迴歸? – speedplane

+0

我正在嘗試單元測試使用'background_thread'功能的代碼。 – DaveBensonPhillips

回答

1

根據此wonky GAE reference guide,看起來google.appengine.api.runtime自1.8.1版開始已被棄用。根據the SDK Release notes,版本1.8.1已有兩年多的歷史。谷歌可能剛剛放棄對它的支持。

如果他們先吐出一個運行時警告,那會很好。

+0

是否有一種不被棄用的方法來獲取實例內存使用情況? –