From 388d986b8a6bb1363dab9f53ea435dff4dfe92cb Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 6 Feb 2015 07:58:31 -0500 Subject: [PATCH] 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. --- django/bin/profiling/__init__.py | 0 django/bin/profiling/gather_profile_stats.py | 38 -------------------- docs/man/gather_profile_stats.1 | 26 -------------- 3 files changed, 64 deletions(-) delete mode 100644 django/bin/profiling/__init__.py delete mode 100644 django/bin/profiling/gather_profile_stats.py delete mode 100644 docs/man/gather_profile_stats.1 diff --git a/django/bin/profiling/__init__.py b/django/bin/profiling/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/django/bin/profiling/gather_profile_stats.py b/django/bin/profiling/gather_profile_stats.py deleted file mode 100644 index dd2733377c..0000000000 --- a/django/bin/profiling/gather_profile_stats.py +++ /dev/null @@ -1,38 +0,0 @@ -#!/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]) diff --git a/docs/man/gather_profile_stats.1 b/docs/man/gather_profile_stats.1 deleted file mode 100644 index 72b443726f..0000000000 --- a/docs/man/gather_profile_stats.1 +++ /dev/null @@ -1,26 +0,0 @@ -.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 - -.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. -