diff options
Diffstat (limited to 'django')
| -rw-r--r-- | django/bin/profiling/__init__.py | 0 | ||||
| -rw-r--r-- | django/bin/profiling/gather_profile_stats.py | 38 |
2 files changed, 0 insertions, 38 deletions
diff --git a/django/bin/profiling/__init__.py b/django/bin/profiling/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 --- a/django/bin/profiling/__init__.py +++ /dev/null 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]) |
