mypy是我自己写的,
McModel在sqlbean中
所有代码都在 http://code.google.com/p/mayoufour/
你可以通过 easy_install -U sqlbean 来安装他
是集成memcache的一种Model
比如这个网页
http://stdyun.com/site/technology?profile=1
看页面最下面可以看到
Memcache access (19/19 calls):
get('FeedEntryTxt:-'): 6 times, 0.000344 seconds
get('Site:-'): 1 times, 0.000029 seconds
get('SiteByUrl:technology'): 1 times, 0.000039 seconds
get('SiteChannelIdList:-'): 1 times, 0.000042 seconds
get('SiteIntro:-'): 1 times, 0.000031 seconds
get('SiteMemberCount:-'): 1 times, 0.000034 seconds
get('SiteMemberType:-_-'): 1 times, 0.000039 seconds
get('SiteOwnerId:-'): 1 times, 0.000030 seconds
get('User:-'): 1 times, 0.000031 seconds
get('UserSession:-'): 1 times, 0.000081 seconds
get_multi(['SiteChannel:-', 'SiteChannel:-', 'SiteChannel:-',
'SiteChannel:-...): 1 times, 0.000046 seconds
get_multi(['SiteChannelLastRidIdList:-', 'SiteChannelLastRidIdList:-',
'SiteCh...): 1 times, 0.000045 seconds
get_multi(['SiteRid-:-', 'SiteRid-:-', 'SiteRid-:-',
'SiteRid-:-',...): 1 times, 0.000131 seconds
get_multi(['SiteRid:-', 'SiteRid:-', 'SiteRid:-', 'SiteRid:-',
'Si...): 1 times, 0.000114 seconds
Detail:
get('FeedEntryTxt:10687'): 1 times
get('FeedEntryTxt:10693'): 1 times
get('FeedEntryTxt:12424'): 1 times
get('FeedEntryTxt:9454'): 1 times
get('FeedEntryTxt:9457'): 1 times
get('FeedEntryTxt:9905'): 1 times
get('Site:12'): 1 times
get('SiteByUrl:technology'): 1 times
get('SiteChannelIdList:12'): 1 times
get('SiteIntro:12'): 1 times
get('SiteMemberCount:12'): 1 times
get('SiteMemberType:12_10000047'): 1 times
get('SiteOwnerId:12'): 1 times
get('User:10000047'): 1 times
get('UserSession:10000047'): 1 times
get_multi(['SiteChannel:25', 'SiteChannel:26', 'SiteChannel:22',
'SiteChannel:23...): 1 times
get_multi(['SiteChannelLastRidIdList:25',
'SiteChannelLastRidIdList:26', 'SiteCh...): 1 times
get_multi(['SiteRid1:9454', 'SiteRid1:10772', 'SiteRid1:10777',
'SiteRid1:9428',...): 1 times
get_multi(['SiteRid:9842', 'SiteRid:12933', 'SiteRid:12928',
'SiteRid:9868', 'Si...): 1 times
这些很大一部分是通过McModel进行是memcache操作
关闭profile用
http://stdyun.com/site/technology?profile=0
PS:
http://groups.google.com/group/pythonbook-comment?lnk=
你可以加入这个论坛来提问,这样可以让大家一起来探讨问题,分享知识:)
--
卖空间 http://stdyun.com/vhost
写书 http://kanrs.com
豆瓣 http://www.douban.com/people/zuroc
博客 http://zsp.javaeye.com
http://code.google.com/p/mayoufour/source/browse/trunk/mypylib/mypy/profile_middleware.py
这个profile基本是洪教授写的:)
我只做一些很小的调整
0.封装成了一个wsgi接口
1.把profile的开关加到cookie中去了,方便查看(不过输出要以<开头,这是为了方便页面的js调用不出错)
2.用了一个PROFILE_FUNC_LIST 变量,这样方便加profile函数
> Qiangning Hong
这个文件也是洪教授写的
还有一些其他的
不过我也搞不清楚有哪些了:)