diff options
| author | Adrian Holovaty <adrian@holovaty.com> | 2005-07-18 06:34:34 +0000 |
|---|---|---|
| committer | Adrian Holovaty <adrian@holovaty.com> | 2005-07-18 06:34:34 +0000 |
| commit | 86d9ae269d969f71e44234493f9af529253391c0 (patch) | |
| tree | b25da6f400b781cc7e9cb1578be2685918997b9e /django/bin/profiling/handler.py | |
| parent | ca3d89b70f30598d8e3a8438fcf4a0050963a21e (diff) | |
Moved django.bin.profiling.handler to django.core.handlers.profiler-hotshot
git-svn-id: http://code.djangoproject.com/svn/django/trunk@170 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/bin/profiling/handler.py')
| -rw-r--r-- | django/bin/profiling/handler.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/django/bin/profiling/handler.py b/django/bin/profiling/handler.py deleted file mode 100644 index 7074be8248..0000000000 --- a/django/bin/profiling/handler.py +++ /dev/null @@ -1,22 +0,0 @@ -import hotshot, time, os -from django.core.handler import ModPythonHandler - -PROFILE_DATA_DIR = "/var/log/cmsprofile/" - -def handler(req): - ''' - Handler that uses hotshot to store profile data. - - Stores profile data in PROFILE_DATA_DIR. Since hotshot has no way (that I - know of) to append profile data to a single file, each request gets its own - profile. The file names are in the format <url>.<n>.prof where <url> is - the request path with "/" replaced by ".", and <n> is a timestamp with - microseconds to prevent overwriting files. - - Use the gather_profile_stats.py script to gather these individual request - profiles into aggregated profiles by request path. - ''' - profname = "%s.%.3f.prof" % (req.uri.strip("/").replace('/', '.'), time.time()) - profname = os.path.join(PROFILE_DATA_DIR, profname) - prof = hotshot.Profile(profname) - return prof.runcall(ModPythonHandler(), req) |
