저는 CherryPy 웹 서버 프로파일 링을 시작하려했지만이 문서의 설정 방법에 대한 자세한 내용은 부족합니다. 내 초기 서버를 마운트하기 위해 미들웨어로 cherrypy.lib.profiler
을 사용할 수 있어야한다는 것을 이해합니다. 바로 지금, 내가 좋아하는 코드가 다음프로파일 링 CherryPy
server_app = ServerClass()
cherrypy.tree.mount(server_app, '/', '/path/to/config/file.cfg')
cherrypy.engine.start()
cherrypy.engine.block()
내가 프로파일 미들웨어를 탑재 할, 그것은 보인다 같은 필수입니다 : 어떤 이유로 cherrypy.tree.mount
를 들어
from cherrypy.lib import profiler
server_app = ServerClass()
server_cpapp = cherrypy.Application(server_app, '/', '/path/to/config/file.cfg')
server_profile_cpapp = profiler.make_app(server_cpapp, '/home/ken/tmp/cprofile', True)
#cherrypy.tree.mount(server_profile_cpapp)
cherrypy.tree.graft(server_profile_cpapp)
cherrypy.engine.start()
cherrypy.engine.block()
하지 않는 내가 cherrypy.tree.graft
을 사용하는 경우 작업,하지만 모두 내가 어떻게에 (내가 정상적으로 서버에 요청을 할 수 있습니다)
그러나, 위의 코드는 /home/ken/tmp/cprofile
아래 cp_0001.prof
파일을 생성하고, 나는 확실하지 않다 잘 작동하는 것 같다 그것을 해석하십시오. pyprof2calltree
을 사용하여 KCacheGrind로 데이터를 읽으려고 시도했지만 구문 분석 오류가 발생합니다. 내가하고있는 일이 맞는지, 그렇다면 어떻게 출력 파일을 해석 할 수 있습니까?
이것을 얻으십시오. –