508 function calls (501 primitive calls) in 0.036 seconds
Ordered by: standard name
ncalls tottime percall cumtime percall filename:lineno(function)
8 0.000 0.000 0.000 0.000 :0(abs)
4 0.000 0.000 0.000 0.000 :0(acquire)
2 0.000 0.000 0.000 0.000 :0(add)
15 0.000 0.000 0.000 0.000 :0(append)
12 0.000 0.000 0.000 0.000 :0(callable)
2 0.000 0.000 0.000 0.000 :0(clear)
6 0.000 0.000 0.000 0.000 :0(copy)
8 0.000 0.000 0.000 0.000 :0(fcntl)
3 0.000 0.000 0.000 0.000 :0(fileno)
4 0.000 0.000 0.000 0.000 :0(flush)
4 0.000 0.000 0.000 0.000 :0(fromtimestamp)
2 0.000 0.000 0.000 0.000 :0(get)
9 0.000 0.000 0.000 0.000 :0(get_ident)
5 0.000 0.000 0.000 0.000 :0(getattr)
1 0.000 0.000 0.000 0.000 :0(getsignal)
2 0.000 0.000 0.000 0.000 :0(gmtime)
2 0.000 0.000 0.000 0.000 :0(hasattr)
3 0.000 0.000 0.000 0.000 :0(heappop)
4 0.000 0.000 0.000 0.000 :0(heappush)
21 0.000 0.000 0.000 0.000 :0(isinstance)
1 0.000 0.000 0.000 0.000 :0(iter)
4 0.000 0.000 0.000 0.000 :0(join)
18 0.000 0.000 0.000 0.000 :0(len)
4 0.000 0.000 0.000 0.000 :0(map)
5 0.000 0.000 0.000 0.000 :0(max)
5 0.000 0.000 0.000 0.000 :0(min)
1 0.000 0.000 0.000 0.000 :0(pipe)
5 0.000 0.000 0.004 0.001 :0(poll)
16 0.000 0.000 0.000 0.000 :0(pop)
4 0.000 0.000 0.000 0.000 :0(range)
2 0.000 0.000 0.000 0.000 :0(read)
1 0.000 0.000 0.000 0.000 :0(register)
4 0.000 0.000 0.000 0.000 :0(release)
# from twisted.internet import reactor
from twisted.application import service, internet
from twisted.web import static, server
from twisted.web.resource import Resource
class Hello(Resource):
def getChild(self, name, request):
return self
def render_GET(self, request):
return '<html>Hello, GET world! I am located at %r. </html>' \
% (request.prepath)
def getWebService():
"""
Return a service suitable for creating an application object.
"""
site = server.Site(Hello())
# site = server.Site(Hello())
# reactor.listenTCP(8000, site)
# reactor.run()
return internet.TCPServer(8000, site)
# this is the core part of any tac file, the creation of the root-level
# application object
application = service.Application("Hello application")
# attach the service to its parent application
service = getWebService()
service.setServiceParent(application)
这是“你好”_字.tac“:”
# from twisted.internet import reactor
from twisted.web import static, server
from twisted.web.resource import Resource
from twisted.application import service, internet
class Hello(Resource):
def getChild(self, name, request):
return self
def render_GET(self, request):
return '<html>Hello, GET world! I am located at %r. </html>' \
% (request.prepath)
def getWebService():
"""
Return a service suitable for creating an application object.
This service is a simple web server that serves files on port 8080 from
underneath the current working directory.
"""
site = server.Site(Hello())
return internet.TCPServer(8000, site)
# this is the core part of any tac file, the creation of the root-level
# application object
application = service.Application("Hello application")
# attach the service to its parent application
service = getWebService()
service.setServiceParent(application)
跑步:
终端输出:
然后:
或者您可以在没有
savestats
:twistd -n -y hello_world.tac profile=pstats_obj profiler=cprofile
的情况下运行这是“你好”_字.tac“:”
一旦分析完毕,就可以添加一个decorator来添加某种钩子(逐行)来分析占用大量时间的调用。你知道吗
geoffgreer的a tool called ^{} 可以向您展示扭曲进程的挂起位置。你知道吗
相关问题 更多 >
编程相关推荐