Re: 张教主好,关于mypy的问题

12 views
Skip to first unread message

张沈鹏

unread,
Nov 26, 2009, 5:13:55 AM11/26/09
to 29lsj, pythonboo...@googlegroups.com
2009/11/26 29lsj <29...@163.com>:
> 张教主:
>
> 看兄台的stdyun有一个叫做mypy的框架,里面好像有一个叫做McModel的东西,我对它很流口水,但在google.cn居然搜不到,能把那个框架mypy发我一份吗?非常感谢!
> 还有想问一下,mypy是张教主自己写的框架吗???
>     此致
> 敬礼
>                                                                阿德
>
>
> ________________________________
> 09年新晋3D主流网游《天下贰》,网易六年亿资打造

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

Qiangning Hong

unread,
Nov 26, 2009, 8:39:13 AM11/26/09
to pythonboo...@googlegroups.com, 29lsj
2009/11/26 张沈鹏 <zsp...@gmail.com>

比如这个网页

http://stdyun.com/site/technology?profile=1

看页面最下面可以看到

Memcache access (19/19 calls):
[...]

呵呵,看到这个输出有点眼熟,一看mypy的 profile_middleware.py ,里面不少代码是我写的 :)

--
Qiangning Hong

张沈鹏

unread,
Nov 26, 2009, 10:04:18 AM11/26/09
to pythonboo...@googlegroups.com, 29lsj
2009/11/26 Qiangning Hong <hon...@gmail.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

张沈鹏

unread,
Nov 26, 2009, 10:14:39 AM11/26/09
to pythonboo...@googlegroups.com, 29lsj
http://code.google.com/p/mayoufour/source/browse/trunk/stdyun/mylib/single_process.py

这个文件也是洪教授写的
还有一些其他的
不过我也搞不清楚有哪些了:)

Reply all
Reply to author
Forward
0 new messages