[Zope] Re: Using the profiler (Was: The Profiler for measuring Zope calculation times)

Kamon Ayeva kamon.ayeva@experts-md.com
Tue, 7 Aug 2001 19:01:53 +0200


Hi,

Thanks to Chris McDonough for his input so far, but the Python profiler is
not the right tool for the problem I currently try to solve on our site,
which is evaluating the time spent in the DTML processing for pages. (When
we have these numbers, we will be able to see if we need to work for tuning
on the publishing side or our Python API side.)
This is a relatively longer email trying to give more explanation on our
need since we think this facility could be needed in Zope in general.

Our version of Zope is Zope 2.2.2 (source release, python 1.5.2, linux2)

Simplified structure of the site :

   + index_html (acquired all through the site)
   + FolderA
       - content_folder
             - Document
             - Document
             - Document
   + FolderB
       - content_folder
             - Document
             - Document

Code in index_html:

<dtml-var html_header>
<dtml-var html_content>
<dtml-var html_footer>

To make it simple enough, html_header and html_footer respectively call
standard_html_header and standard_html_footer methods.

Code in html_content (also sits at the root):

<dtml-if content_folder>
   <dtml-with content_folder>
      <dtml-in "objectValues (['DTML Document'])" sort=id skip_unauthorized>
          <H1> <dtml-var title> </H1>
          <dtml-var "_['sequence-item']">
      </dtml-in>
   </dtml-with>
</dtml-if>

Note that in reality, the structure is a lot more complex, and that's why we
need a tool for the profiling, but at Document Templates level, not Python
level.
What we would need is to get for each Url processed / rendered:
1/ the list of called DTML objects (Python scripts if any)
2/ the total time for each object
3/ the number of calls for each object

So for example, if I hit the Url http://www.mysite.com/FolderA, I will get
the following profiling report:

method                                     total time
number of calls

index_html                                 910 ms
1
html_header                               250 ms
1
standard_html_header                  50 ms
1
html_footer                                100 ms
1
standard_html_footer                   10 ms
1
html_content                               500 ms
5

Do other people have the same need for getting to know the bottleneck parts
of their DTML structure ?

Thanks,
Kamon
eXperts-MD