Files
tryton/bin/trytond
T

28 lines
900 B
Python
Raw Normal View History

2007-12-10 01:04:13 +01:00
#!/usr/bin/env python
2008-06-23 20:18:54 +02:00
#This file is part of Tryton. The COPYRIGHT file at the top level of this repository contains the full copyright notices and license terms.
import sys, os
DIR = os.path.abspath(os.path.normpath(os.path.join(__file__,
'..', '..', 'trytond')))
if os.path.isdir(DIR):
sys.path.insert(0, os.path.dirname(DIR))
2007-12-10 01:04:13 +01:00
import trytond
2007-12-10 21:17:22 +01:00
if 0:
import profile
2008-04-01 16:05:55 +02:00
import pstats
import tempfile
import os
statfile = tempfile.mkstemp(".stat","trytond-")[1]
profile.run('trytond.TrytonServer().run()', statfile)
s = pstats.Stats(statfile)
s.strip_dirs().sort_stats('cumulative').print_stats(50)
s.strip_dirs().sort_stats('call').print_stats(50)
s.strip_dirs().sort_stats('time').print_stats(50)
s.strip_dirs().sort_stats('time')
s.print_callers(20)
s.print_callees(20)
os.remove(statfile)
2007-12-10 21:17:22 +01:00
else:
trytond.server.TrytonServer().run()