Commit 388d986b authored by Tim Graham's avatar Tim Graham
Browse files

Removed gather_profile_stats.py

This script uses the unmaintained hotshot module (gone on Python 3)
and doesn't seem to be Django specific in any way.
parent aea103b6
Loading
Loading
Loading
Loading

django/bin/profiling/__init__.py

deleted100644 → 0
+0 −0

Empty file deleted.

+0 −38
Original line number Diff line number Diff line
#!/usr/bin/env python

"""
gather_profile_stats.py /path/to/dir/of/profiles

Note that the aggregated profiles must be read with pstats.Stats, not
hotshot.stats (the formats are incompatible)
"""

from hotshot import stats
import os
import pstats
import sys


def gather_stats(p):
    profiles = {}
    for f in os.listdir(p):
        if f.endswith('.agg.prof'):
            path = f[:-9]
            prof = pstats.Stats(os.path.join(p, f))
        elif f.endswith('.prof'):
            bits = f.split('.')
            path = ".".join(bits[:-3])
            prof = stats.load(os.path.join(p, f))
        else:
            continue
        print("Processing %s" % f)
        if path in profiles:
            profiles[path].add(prof)
        else:
            profiles[path] = prof
        os.unlink(os.path.join(p, f))
    for (path, prof) in profiles.items():
        prof.dump_stats(os.path.join(p, "%s.agg.prof" % path))

if __name__ == '__main__':
    gather_stats(sys.argv[1])

docs/man/gather_profile_stats.1

deleted100644 → 0
+0 −26
Original line number Diff line number Diff line
.TH "gather_profile_stats.py" "1" "August 2007" "Django Project" ""
.SH "NAME"
gather_profile_stats.py \- Performance analysis tool for the Django Web
framework
.SH "SYNOPSIS"
.B python gather_profile_stats.py
.I <path>

.SH "DESCRIPTION"
This utility script aggregates profiling logs generated using Python's
hotshot profiler. The sole command-line argument is the full path to the
directory containing the profiling logfiles.

.SH "SEE ALSO"
Discussion of profiling Django applications on the Django project's wiki:
.sp
.I https://www.djangoproject.com/wiki/ProfilingDjango

.SH "AUTHORS/CREDITS"
Originally developed at World Online in Lawrence, Kansas, USA. Refer to the
AUTHORS file in the Django distribution for contributors.

.SH "LICENSE"
New BSD license. For the full license text refer to the LICENSE file in the
Django distribution.