<%include file="/pageheader.html"/> <% import sys from kaithem.src import unitsofmeasure %>

Profiler

<% try: import yappi _yappi = True except: _yappi = False %> %if _yappi:
%if not yappi.is_running():
Start the profiler
%else:
Stop the profiler
%endif
Clear Profile Data
%if yappi.is_running(): <% if sort == 'total': sorter = lambda x: x.ttot else: sorter = lambda x: x.tsub #yappi have two api's in different versions if hasattr(yappi,"get_stats"): stats = yappi.get_stats().func_stats gn = lambda x: x.name else: gn = lambda x: x.full_name stats= yappi.get_func_stats() %>

Statistics

%for i in sorted(stats, key=sorter, reverse=True): %if not hasattr(i,"module"): %else: %endif %endfor
Module Name Line Call Count Total Subtime Average Time Total Time
${0} ${i.name} ${0} ${unitsofmeasure.si_format_number(i.ncall)} ${unitsofmeasure.si_format_number(i.tsub)}s ${unitsofmeasure.si_format_number(i.tavg)}s ${unitsofmeasure.si_format_number(i.ttot)}s${i.module} ${i.name} ${i.lineno} ${unitsofmeasure.si_format_number(i.ncall)} ${unitsofmeasure.si_format_number(i.tsub)}s ${unitsofmeasure.si_format_number(i.tavg)}s ${unitsofmeasure.si_format_number(i.ttot)}s
%endif %else:

Profiler disabled. Is the python package "yappi" missing?

%endif
<%include file="/pagefooter.html"/>