Back to index

moin  1.9.0~rc2
MoinMoin.util.profile Namespace Reference


class  Profiler
class  TwistedProfiler

Detailed Description

profile - moin profiling utilities

This module provides profilers used to profile the memory usage of a
long running process.

Typical usage:

 1. Create a profiler:

    from MoinMoin.util.profile import Profiler
    profiler = Profiler('my log')

 2. In the request handler, add each request to the profiler:


 3. If you like, you can add extra samples:


You can customize the profiler when you create it:

 * requestsPerSample (default 100):

   How many requests to run between samples. Set higher for live wiki or
   lower for more accurate results.

 * collect (default 0):

   Use gc.collect to force a memory cleanup each sample. Keeps the
   memory usage much lower, but your profile data will not reflect the
   real world memory usage of the application.

Based on code by Oliver Graf

@copyright: 2004 Nir Soffer
@license: GNU GPL, see COPYING for details.