[Jifty-commit] r6366 - in jifty/trunk: bin
Jifty commits
jifty-commit at lists.jifty.org
Fri Feb 20 17:55:59 EST 2009
Author: sartak
Date: Fri Feb 20 17:55:59 2009
New Revision: 6366
Modified:
jifty/trunk/ (props changed)
jifty/trunk/bin/memory_log
Log:
r78896 at onn: sartak | 2009-01-23 15:54:32 -0500
Do deaths separately, instead of minus hundreds of megs
Modified: jifty/trunk/bin/memory_log
==============================================================================
--- jifty/trunk/bin/memory_log (original)
+++ jifty/trunk/bin/memory_log Fri Feb 20 17:55:59 2009
@@ -7,13 +7,21 @@
die "No files to analyze" if @ARGV == 0;
my @hits;
+my @deaths;
for my $logfile (@ARGV) {
my @entries = LoadFile($logfile);
for (my $i = 1; $i < @entries; ++$i) {
+ if (!defined($entries[$i]{memory})) {
+ # died during request
+ push @deaths, $entries[$i]{ENV}{PATH_INFO};
+ next;
+ }
+
my $delta_memory = $entries[$i]{memory} - $entries[$i-1]{memory};
my $path = $entries[$i]{ENV}{PATH_INFO};
- push @hits, [$delta_memory, $path] if $delta_memory != 0;
+ my $took = $entries[$i]{took};
+ push @hits, [$delta_memory, $path, $took] if $delta_memory != 0;
}
}
@@ -29,6 +37,13 @@
$human_readable = ($hit->[0] > 0 ? '+' : '-')
. $human_readable;
- print "$hit->[1]: $human_readable\n";
+ print "$hit->[1]: $human_readable, took $hit->[2]\n";
+}
+
+if (@deaths) {
+ print "I died while processing the following URLs:\n";
+ for my $death (@deaths) {
+ print "$death\n";
+ }
}
More information about the Jifty-commit
mailing list